{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Nodejs MNIST model Deployment\n",
    "\n",
    " * Wrap a nodejs tensorflow model for use as a prediction microservice in seldon-core\n",
    "   * Run locally on Docker to test\n",
    " \n",
    "## Dependencies\n",
    "\n",
    " * ```pip install seldon-core```\n",
    " * [Helm](https://github.com/kubernetes/helm)\n",
    " * [Minikube](https://github.com/kubernetes/minikube)\n",
    " * [S2I](https://github.com/openshift/source-to-image)\n",
    " * node (version>=8.11.0)\n",
    " * npm\n",
    "\n",
    "## Train locally using npm commands\n",
    " This model takes in mnist images of size 28x28x1 as input and outputs an array of size 10 with prediction of each digits from 0-9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "npm install\n",
      "\u001b[K\u001b[?25h        \u001b[27m\u001b[90m......\u001b[0m] \\ refresh-package-json:argparse: \u001b[32;40mtiming\u001b[0m \u001b[35maction:finalize\u001b[0m Co\u001b[0m\u001b[K\n",
      "> @tensorflow/tfjs-node@0.1.15 install /home/clive/work/seldon-core/fork-seldon-core/examples/models/nodejs_mnist/node_modules/@tensorflow/tfjs-node\n",
      "> node scripts/install.js\n",
      "\n",
      "* Downloading libtensorflow\n",
      "\u001b[1G[                              ] 1180235/bps 0% 16.7s\u001b[0K\u001b[1G[                              ] 1875303/bps 0% 10.5s\u001b[0K\u001b[1G[                              ] 2741939/bps 1% 7.2s\u001b[0K\u001b[1G[                              ] 3032508/bps 1% 6.5s\u001b[0K\u001b[1G[=                             ] 4188852/bps 2% 4.6s\u001b[0K\u001b[1G[=                             ] 4196020/bps 2% 4.6s\u001b[0K\u001b[1G[=                             ] 3919906/bps 3% 4.9s\u001b[0K\u001b[1G[=                             ] 4554618/bps 3% 4.2s\u001b[0K\u001b[1G[=                             ] 5345319/bps 4% 3.5s\u001b[0K\u001b[1G[==                            ] 5635676/bps 5% 3.3s\u001b[0K\u001b[1G[==                            ] 7673917/bps 7% 2.4s\u001b[0K\u001b[1G[===                           ] 8695962/bps 9% 2.1s\u001b[0K\u001b[1G[===                           ] 8116991/bps 10% 2.2s\u001b[0K\u001b[1G[====                          ] 8513097/bps 12% 2.0s\u001b[0K\u001b[1G[====                          ] 8410939/bps 13% 2.1s\u001b[0K\u001b[1G[====                          ] 8673246/bps 14% 2.0s\u001b[0K\u001b[1G[=====                         ] 9525507/bps 16% 1.7s\u001b[0K\u001b[1G[=====                         ] 10068442/bps 18% 1.6s\u001b[0K\u001b[1G[======                        ] 10564293/bps 20% 1.5s\u001b[0K\u001b[1G[======                        ] 10311254/bps 20% 1.5s\u001b[0K\u001b[1G[======                        ] 10324710/bps 21% 1.5s\u001b[0K\u001b[1G[=======                       ] 10551756/bps 23% 1.4s\u001b[0K\u001b[1G[=======                       ] 10651449/bps 24% 1.4s\u001b[0K\u001b[1G[=======                       ] 10507130/bps 24% 1.4s\u001b[0K\u001b[1G[========                      ] 11083294/bps 27% 1.3s\u001b[0K\u001b[1G[=========                     ] 10975382/bps 29% 1.3s\u001b[0K\u001b[1G[=========                     ] 11084185/bps 30% 1.2s\u001b[0K\u001b[1G[=========                     ] 11108293/bps 31% 1.2s\u001b[0K\u001b[1G[==========                    ] 11150222/bps 33% 1.2s\u001b[0K\u001b[1G[==========                    ] 11199892/bps 33% 1.2s\u001b[0K\u001b[1G[==========                    ] 11255565/bps 35% 1.1s\u001b[0K\u001b[1G[===========                   ] 11298406/bps 36% 1.1s\u001b[0K\u001b[1G[===========                   ] 11279950/bps 37% 1.1s\u001b[0K\u001b[1G[===========                   ] 11335154/bps 38% 1.1s\u001b[0K\u001b[1G[============                  ] 11461561/bps 39% 1.0s\u001b[0K\u001b[1G[============                  ] 11322851/bps 40% 1.0s\u001b[0K\u001b[1G[============                  ] 11328628/bps 41% 1.0s\u001b[0K\u001b[1G[=============                 ] 11569110/bps 43% 1.0s\u001b[0K\u001b[1G[=============                 ] 11394723/bps 43% 1.0s\u001b[0K\u001b[1G[=============                 ] 11119219/bps 44% 1.0s\u001b[0K\u001b[1G[==============                ] 11200476/bps 46% 1.0s\u001b[0K\u001b[1G[==============                ] 11327456/bps 47% 0.9s\u001b[0K\u001b[1G[==============                ] 11185786/bps 48% 0.9s\u001b[0K\u001b[1G[===============               ] 11092156/bps 49% 0.9s\u001b[0K\u001b[1G[===============               ] 11057818/bps 50% 0.9s\u001b[0K\u001b[1G[===============               ] 11169269/bps 51% 0.9s\u001b[0K\u001b[1G[===============               ] 11017133/bps 52% 0.9s\u001b[0K\u001b[1G[================              ] 11178032/bps 53% 0.8s\u001b[0K\u001b[1G[================              ] 11042508/bps 53% 0.8s\u001b[0K\u001b[1G[================              ] 11034122/bps 55% 0.8s\u001b[0K\u001b[1G[=================             ] 11136514/bps 56% 0.8s\u001b[0K\u001b[1G[=================             ] 11187099/bps 57% 0.8s\u001b[0K\u001b[1G[==================            ] 11267984/bps 59% 0.7s\u001b[0K\u001b[1G[==================            ] 11277706/bps 60% 0.7s\u001b[0K\u001b[1G[==================            ] 11120431/bps 61% 0.7s\u001b[0K\u001b[1G[===================           ] 11001318/bps 62% 0.7s\u001b[0K\u001b[1G[===================           ] 10961331/bps 63% 0.7s\u001b[0K\u001b[1G[===================           ] 11194304/bps 65% 0.6s\u001b[0K\u001b[1G[====================          ] 11293962/bps 66% 0.6s\u001b[0K\u001b[1G[====================          ] 11124598/bps 67% 0.6s\u001b[0K\u001b[1G[=====================         ] 11200894/bps 69% 0.5s\u001b[0K\u001b[1G[=====================         ] 11152804/bps 70% 0.5s\u001b[0K\u001b[1G[=====================         ] 11284431/bps 72% 0.5s\u001b[0K\u001b[1G[======================        ] 11148271/bps 72% 0.5s\u001b[0K\u001b[1G[======================        ] 11149697/bps 73% 0.5s\u001b[0K\u001b[1G[======================        ] 11250762/bps 75% 0.4s\u001b[0K\u001b[1G[=======================       ] 11291676/bps 76% 0.4s\u001b[0K\u001b[1G[=======================       ] 11344624/bps 78% 0.4s\u001b[0K\u001b[1G[=======================       ] 11224529/bps 78% 0.4s\u001b[0K\u001b[1G[========================      ] 11293257/bps 80% 0.3s\u001b[0K\u001b[1G[========================      ] 11269785/bps 81% 0.3s\u001b[0K\u001b[1G[=========================     ] 11268995/bps 82% 0.3s\u001b[0K\u001b[1G[=========================     ] 11256269/bps 83% 0.3s\u001b[0K\u001b[1G[=========================     ] 11148678/bps 83% 0.3s\u001b[0K\u001b[1G[=========================     ] 11177869/bps 85% 0.3s\u001b[0K\u001b[1G[==========================    ] 11138957/bps 85% 0.3s\u001b[0K\u001b[1G[==========================    ] 11235963/bps 87% 0.2s\u001b[0K\u001b[1G[==========================    ] 11239572/bps 88% 0.2s\u001b[0K\u001b[1G[===========================   ] 11305796/bps 90% 0.2s\u001b[0K\u001b[1G[===========================   ] 11334843/bps 91% 0.2s\u001b[0K\u001b[1G[============================  ] 11302114/bps 92% 0.1s\u001b[0K\u001b[1G[============================  ] 11233882/bps 93% 0.1s\u001b[0K\u001b[1G[============================  ] 11240417/bps 94% 0.1s\u001b[0K\u001b[1G[============================  ] 11171803/bps 94% 0.1s\u001b[0K\u001b[1G[============================  ] 11133717/bps 95% 0.1s\u001b[0K\u001b[1G[============================= ] 11128391/bps 96% 0.1s\u001b[0K\u001b[1G[============================= ] 11139209/bps 97% 0.1s\u001b[0K\u001b[1G[============================= ] 11140363/bps 98% 0.0s\u001b[0K\u001b[1G[============================= ] 11116375/bps 98% 0.0s\u001b[0K\u001b[1G[==============================] 11154472/bps 100% 0.0s\u001b[0K\u001b[1G[==============================] 11158360/bps 100% 0.0s\u001b[0K\n",
      "* Building TensorFlow Node.js bindings\n",
      "\n",
      "> protobufjs@6.8.8 postinstall /home/clive/work/seldon-core/fork-seldon-core/examples/models/nodejs_mnist/node_modules/protobufjs\n",
      "> node scripts/postinstall\n",
      "\n",
      "\u001b[37;40mnpm\u001b[0m \u001b[0m\u001b[34;40mnotice\u001b[0m\u001b[35m\u001b[0m created a lockfile as package-lock.json. You should commit this file.\n",
      "\u001b[0m\u001b[37;40mnpm\u001b[0m \u001b[0m\u001b[30;43mWARN\u001b[0m\u001b[35m\u001b[0m nodejs_mnist@1.0.0 No repository field.\n",
      "\u001b[0m\u001b[37;40mnpm\u001b[0m \u001b[0m\u001b[30;43mWARN\u001b[0m\u001b[35m\u001b[0m nodejs_mnist@1.0.0 No license field.\n",
      "\u001b[0m\n",
      "added 50 packages from 58 contributors and audited 64 packages in 8.793s\n",
      "found \u001b[92m0\u001b[0m vulnerabilities\n",
      "\n",
      "\u001b[K\u001b[?25hnpm start      \u001b[27m\u001b[90m.....\u001b[0m] - prepare:nodejs_mnist: \u001b[7msill\u001b[0m \u001b[35minstall\u001b[0m printInstalled\u001b[0m\u001b[K\n",
      "\n",
      "> nodejs_mnist@1.0.0 start /home/clive/work/seldon-core/fork-seldon-core/examples/models/nodejs_mnist\n",
      "> node train.js --epoch 1 --batch_size 128 --model_save_path /\n",
      "\n",
      "2019-04-16 15:13:12.477002: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA\n",
      "1 128 '/home/clive/work/seldon-core/fork-seldon-core/examples/models/nodejs_mnist/'\n",
      "  * Downloading from: https://storage.googleapis.com/cvdf-datasets/mnist/train-images-idx3-ubyte.gz\n",
      "  * Downloading from: https://storage.googleapis.com/cvdf-datasets/mnist/train-labels-idx1-ubyte.gz\n",
      "  * Downloading from: https://storage.googleapis.com/cvdf-datasets/mnist/t10k-images-idx3-ubyte.gz\n",
      "  * Downloading from: https://storage.googleapis.com/cvdf-datasets/mnist/t10k-labels-idx1-ubyte.gz\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output shape              Param #   \n",
      "=================================================================\n",
      "conv2d_Conv2D1 (Conv2D)      [null,26,26,32]           320       \n",
      "_________________________________________________________________\n",
      "conv2d_Conv2D2 (Conv2D)      [null,24,24,32]           9248      \n",
      "_________________________________________________________________\n",
      "max_pooling2d_MaxPooling2D1  [null,12,12,32]           0         \n",
      "_________________________________________________________________\n",
      "conv2d_Conv2D3 (Conv2D)      [null,10,10,64]           18496     \n",
      "_________________________________________________________________\n",
      "conv2d_Conv2D4 (Conv2D)      [null,8,8,64]             36928     \n",
      "_________________________________________________________________\n",
      "max_pooling2d_MaxPooling2D2  [null,4,4,64]             0         \n",
      "_________________________________________________________________\n",
      "flatten_Flatten1 (Flatten)   [null,1024]               0         \n",
      "_________________________________________________________________\n",
      "dropout_Dropout1 (Dropout)   [null,1024]               0         \n",
      "_________________________________________________________________\n",
      "dense_Dense1 (Dense)         [null,512]                524800    \n",
      "_________________________________________________________________\n",
      "dropout_Dropout2 (Dropout)   [null,512]                0         \n",
      "_________________________________________________________________\n",
      "dense_Dense2 (Dense)         [null,10]                 5130      \n",
      "=================================================================\n",
      "Total params: 594922\n",
      "Trainable params: 594922\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "2019-04-16 15:13:14.898522: W tensorflow/core/framework/allocator.cc:108] Allocation of 188160000 exceeds 10% of system memory.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1 / 1\n",
      "2019-04-16 15:13:15.271799: W tensorflow/core/framework/allocator.cc:108] Allocation of 27205632 exceeds 10% of system memory.\n",
      "2019-04-16 15:13:15.305068: W tensorflow/core/framework/allocator.cc:108] Allocation of 27205632 exceeds 10% of system memory.\n",
      "2019-04-16 15:13:15.671412: W tensorflow/core/framework/allocator.cc:108] Allocation of 27205632 exceeds 10% of system memory.\n",
      "2019-04-16 15:13:15.701788: W tensorflow/core/framework/allocator.cc:108] Allocation of 27205632 exceeds 10% of system memory.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1G-------------------------------------------------------------------------: 152.4\u001b[0K\u001b[1G-------------------------------------------------------------------------: 145.1\u001b[0K\u001b[1G>------------------------------------------------------------------------: 143.2\u001b[0K\u001b[1G>------------------------------------------------------------------------: 147.7\u001b[0K\u001b[1G>------------------------------------------------------------------------: 146.9\u001b[0K\u001b[1G>------------------------------------------------------------------------: 146.5\u001b[0K\u001b[1G>------------------------------------------------------------------------: 148.6\u001b[0K\u001b[1G>------------------------------------------------------------------------: 146.7\u001b[0K\u001b[1G=>-----------------------------------------------------------------------: 144.8\u001b[0K\u001b[1G=>-----------------------------------------------------------------------: 144.6\u001b[0K\u001b[1G=>-----------------------------------------------------------------------: 143.8\u001b[0K\u001b[1G=>-----------------------------------------------------------------------: 142.5\u001b[0K\u001b[1G=>-----------------------------------------------------------------------: 142.6\u001b[0K\u001b[1G==>----------------------------------------------------------------------: 141.2\u001b[0K\u001b[1G==>----------------------------------------------------------------------: 139.6\u001b[0K\u001b[1G==>----------------------------------------------------------------------: 138.5\u001b[0K\u001b[1G==>----------------------------------------------------------------------: 138.3\u001b[0K\u001b[1G==>----------------------------------------------------------------------: 138.0\u001b[0K\u001b[1G==>----------------------------------------------------------------------: 137.1\u001b[0K\u001b[1G===>---------------------------------------------------------------------: 137.1\u001b[0K\u001b[1G===>---------------------------------------------------------------------: 136.3\u001b[0K\u001b[1G===>---------------------------------------------------------------------: 135.5\u001b[0K\u001b[1G===>---------------------------------------------------------------------: 135.7\u001b[0K\u001b[1G===>---------------------------------------------------------------------: 135.8\u001b[0K\u001b[1G====>--------------------------------------------------------------------: 135.8\u001b[0K\u001b[1G====>--------------------------------------------------------------------: 136.1\u001b[0K\u001b[1G====>--------------------------------------------------------------------: 136.0\u001b[0K\u001b[1G====>--------------------------------------------------------------------: 135.6\u001b[0K\u001b[1G====>--------------------------------------------------------------------: 135.9\u001b[0K\u001b[1G====>--------------------------------------------------------------------: 135.7\u001b[0K\u001b[1G=====>-------------------------------------------------------------------: 135.4\u001b[0K\u001b[1G=====>-------------------------------------------------------------------: 135.7\u001b[0K\u001b[1G=====>-------------------------------------------------------------------: 135.9\u001b[0K\u001b[1G=====>-------------------------------------------------------------------: 135.6\u001b[0K\u001b[1G======>------------------------------------------------------------------: 135.4\u001b[0K\u001b[1G======>------------------------------------------------------------------: 135.5\u001b[0K\u001b[1G======>------------------------------------------------------------------: 135.6\u001b[0K\u001b[1G======>------------------------------------------------------------------: 135.0\u001b[0K\u001b[1G======>------------------------------------------------------------------: 134.6\u001b[0K\u001b[1G=======>-----------------------------------------------------------------: 134.5\u001b[0K\u001b[1G=======>-----------------------------------------------------------------: 134.1\u001b[0K\u001b[1G=======>-----------------------------------------------------------------: 133.7\u001b[0K\u001b[1G=======>-----------------------------------------------------------------: 134.5\u001b[0K\u001b[1G=======>-----------------------------------------------------------------: 135.2\u001b[0K\u001b[1G========>----------------------------------------------------------------: 134.9\u001b[0K\u001b[1G========>----------------------------------------------------------------: 134.5\u001b[0K\u001b[1G========>----------------------------------------------------------------: 134.9\u001b[0K\u001b[1G========>----------------------------------------------------------------: 135.3\u001b[0K\u001b[1G========>----------------------------------------------------------------: 134.8\u001b[0K\u001b[1G=========>---------------------------------------------------------------: 134.6\u001b[0K\u001b[1G=========>---------------------------------------------------------------: 134.0\u001b[0K\u001b[1G=========>---------------------------------------------------------------: 133.5\u001b[0K\u001b[1G=========>---------------------------------------------------------------: 133.2\u001b[0K\u001b[1G=========>---------------------------------------------------------------: 132.6\u001b[0K\u001b[1G=========>---------------------------------------------------------------: 132.2\u001b[0K\u001b[1G==========>--------------------------------------------------------------: 132.1\u001b[0K\u001b[1G==========>--------------------------------------------------------------: 131.8\u001b[0K\u001b[1G==========>--------------------------------------------------------------: 131.4\u001b[0K\u001b[1G==========>--------------------------------------------------------------: 131.1\u001b[0K\u001b[1G==========>--------------------------------------------------------------: 130.7\u001b[0K\u001b[1G===========>-------------------------------------------------------------: 130.2\u001b[0K\u001b[1G===========>-------------------------------------------------------------: 130.0\u001b[0K\u001b[1G===========>-------------------------------------------------------------: 129.6\u001b[0K\u001b[1G===========>-------------------------------------------------------------: 129.1\u001b[0K\u001b[1G===========>-------------------------------------------------------------: 128.9\u001b[0K\u001b[1G===========>-------------------------------------------------------------: 128.6\u001b[0K\u001b[1G============>------------------------------------------------------------: 128.2\u001b[0K\u001b[1G============>------------------------------------------------------------: 128.0\u001b[0K\u001b[1G============>------------------------------------------------------------: 127.7\u001b[0K\u001b[1G============>------------------------------------------------------------: 127.5\u001b[0K\u001b[1G============>------------------------------------------------------------: 127.0\u001b[0K\u001b[1G=============>-----------------------------------------------------------: 126.4\u001b[0K\u001b[1G=============>-----------------------------------------------------------: 126.1\u001b[0K\u001b[1G=============>-----------------------------------------------------------: 125.7\u001b[0K\u001b[1G=============>-----------------------------------------------------------: 125.5\u001b[0K\u001b[1G=============>-----------------------------------------------------------: 125.2\u001b[0K\u001b[1G=============>-----------------------------------------------------------: 124.7\u001b[0K\u001b[1G==============>----------------------------------------------------------: 124.3\u001b[0K\u001b[1G==============>----------------------------------------------------------: 123.8\u001b[0K\u001b[1G==============>----------------------------------------------------------: 123.4\u001b[0K\u001b[1G==============>----------------------------------------------------------: 123.1\u001b[0K\u001b[1G==============>----------------------------------------------------------: 122.8\u001b[0K\u001b[1G===============>---------------------------------------------------------: 122.4\u001b[0K\u001b[1G===============>---------------------------------------------------------: 122.1\u001b[0K\u001b[1G===============>---------------------------------------------------------: 121.9\u001b[0K\u001b[1G===============>---------------------------------------------------------: 121.6\u001b[0K\u001b[1G===============>---------------------------------------------------------: 121.2\u001b[0K\u001b[1G===============>---------------------------------------------------------: 121.0\u001b[0K\u001b[1G================>--------------------------------------------------------: 120.6\u001b[0K\u001b[1G================>--------------------------------------------------------: 120.2\u001b[0K\u001b[1G================>--------------------------------------------------------: 120.0\u001b[0K\u001b[1G================>--------------------------------------------------------: 119.5\u001b[0K\u001b[1G================>--------------------------------------------------------: 119.0\u001b[0K\u001b[1G=================>-------------------------------------------------------: 118.7\u001b[0K"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1G=================>-------------------------------------------------------: 118.2\u001b[0K\u001b[1G=================>-------------------------------------------------------: 117.8\u001b[0K\u001b[1G=================>-------------------------------------------------------: 117.5\u001b[0K\u001b[1G=================>-------------------------------------------------------: 117.0\u001b[0K\u001b[1G=================>-------------------------------------------------------: 116.6\u001b[0K\u001b[1G==================>------------------------------------------------------: 116.3\u001b[0K\u001b[1G==================>------------------------------------------------------: 115.9\u001b[0K\u001b[1G==================>------------------------------------------------------: 115.5\u001b[0K\u001b[1G==================>------------------------------------------------------: 115.2\u001b[0K\u001b[1G==================>------------------------------------------------------: 114.8\u001b[0K\u001b[1G===================>-----------------------------------------------------: 114.6\u001b[0K\u001b[1G===================>-----------------------------------------------------: 114.2\u001b[0K\u001b[1G===================>-----------------------------------------------------: 114.0\u001b[0K\u001b[1G===================>-----------------------------------------------------: 113.7\u001b[0K\u001b[1G===================>-----------------------------------------------------: 113.3\u001b[0K\u001b[1G===================>-----------------------------------------------------: 112.8\u001b[0K\u001b[1G====================>----------------------------------------------------: 112.5\u001b[0K\u001b[1G====================>----------------------------------------------------: 112.1\u001b[0K\u001b[1G====================>----------------------------------------------------: 111.7\u001b[0K\u001b[1G====================>----------------------------------------------------: 111.4\u001b[0K\u001b[1G====================>----------------------------------------------------: 111.0\u001b[0K\u001b[1G=====================>---------------------------------------------------: 110.7\u001b[0K\u001b[1G=====================>---------------------------------------------------: 110.3\u001b[0K\u001b[1G=====================>---------------------------------------------------: 109.8\u001b[0K\u001b[1G=====================>---------------------------------------------------: 109.4\u001b[0K\u001b[1G=====================>---------------------------------------------------: 109.0\u001b[0K\u001b[1G======================>--------------------------------------------------: 108.5\u001b[0K\u001b[1G======================>--------------------------------------------------: 108.1\u001b[0K\u001b[1G======================>--------------------------------------------------: 107.8\u001b[0K\u001b[1G======================>--------------------------------------------------: 107.4\u001b[0K\u001b[1G======================>--------------------------------------------------: 107.0\u001b[0K\u001b[1G======================>--------------------------------------------------: 106.7\u001b[0K\u001b[1G=======================>-------------------------------------------------: 106.2\u001b[0K\u001b[1G=======================>-------------------------------------------------: 105.8\u001b[0K\u001b[1G=======================>-------------------------------------------------: 105.5\u001b[0K\u001b[1G=======================>-------------------------------------------------: 105.4\u001b[0K\u001b[1G========================>------------------------------------------------: 105.0\u001b[0K\u001b[1G========================>------------------------------------------------: 104.6\u001b[0K\u001b[1G========================>------------------------------------------------: 104.2\u001b[0K\u001b[1G========================>------------------------------------------------: 103.8\u001b[0K\u001b[1G========================>------------------------------------------------: 103.3\u001b[0K\u001b[1G========================>------------------------------------------------: 102.9\u001b[0K\u001b[1G=========================>-----------------------------------------------: 102.5\u001b[0K\u001b[1G=========================>-----------------------------------------------: 102.0\u001b[0K\u001b[1G=========================>-----------------------------------------------: 101.7\u001b[0K\u001b[1G=========================>-----------------------------------------------: 101.3\u001b[0K\u001b[1G=========================>-----------------------------------------------: 100.9\u001b[0K\u001b[1G==========================>----------------------------------------------: 100.5\u001b[0K\u001b[1G==========================>----------------------------------------------: 100.1\u001b[0K\u001b[1G==========================>-----------------------------------------------: 99.7\u001b[0K\u001b[1G==========================>-----------------------------------------------: 99.2\u001b[0K\u001b[1G===========================>----------------------------------------------: 98.8\u001b[0K\u001b[1G===========================>----------------------------------------------: 98.3\u001b[0K\u001b[1G===========================>----------------------------------------------: 97.9\u001b[0K\u001b[1G===========================>----------------------------------------------: 97.5\u001b[0K\u001b[1G===========================>----------------------------------------------: 97.1\u001b[0K\u001b[1G============================>---------------------------------------------: 96.7\u001b[0K\u001b[1G============================>---------------------------------------------: 96.3\u001b[0K\u001b[1G============================>---------------------------------------------: 95.8\u001b[0K\u001b[1G============================>---------------------------------------------: 95.4\u001b[0K\u001b[1G============================>---------------------------------------------: 95.0\u001b[0K\u001b[1G============================>---------------------------------------------: 94.6\u001b[0K\u001b[1G=============================>--------------------------------------------: 94.2\u001b[0K\u001b[1G=============================>--------------------------------------------: 93.7\u001b[0K\u001b[1G=============================>--------------------------------------------: 93.3\u001b[0K\u001b[1G=============================>--------------------------------------------: 92.9\u001b[0K\u001b[1G=============================>--------------------------------------------: 92.5\u001b[0K\u001b[1G==============================>-------------------------------------------: 92.1\u001b[0K\u001b[1G==============================>-------------------------------------------: 91.7\u001b[0K\u001b[1G==============================>-------------------------------------------: 91.4\u001b[0K\u001b[1G==============================>-------------------------------------------: 90.9\u001b[0K\u001b[1G==============================>-------------------------------------------: 90.6\u001b[0K\u001b[1G===============================>------------------------------------------: 90.2\u001b[0K\u001b[1G===============================>------------------------------------------: 89.8\u001b[0K\u001b[1G===============================>------------------------------------------: 89.4\u001b[0K\u001b[1G===============================>------------------------------------------: 89.0\u001b[0K\u001b[1G===============================>------------------------------------------: 88.5\u001b[0K\u001b[1G===============================>------------------------------------------: 88.1\u001b[0K\u001b[1G================================>-----------------------------------------: 87.7\u001b[0K\u001b[1G================================>-----------------------------------------: 87.3\u001b[0K\u001b[1G================================>-----------------------------------------: 86.9\u001b[0K\u001b[1G================================>-----------------------------------------: 86.5\u001b[0K\u001b[1G================================>-----------------------------------------: 86.0\u001b[0K\u001b[1G=================================>----------------------------------------: 85.7\u001b[0K\u001b[1G=================================>----------------------------------------: 85.2\u001b[0K\u001b[1G=================================>----------------------------------------: 84.8\u001b[0K\u001b[1G=================================>----------------------------------------: 84.5\u001b[0K\u001b[1G=================================>----------------------------------------: 84.0\u001b[0K\u001b[1G=================================>----------------------------------------: 83.6\u001b[0K\u001b[1G==================================>---------------------------------------: 83.2\u001b[0K\u001b[1G==================================>---------------------------------------: 82.8\u001b[0K\u001b[1G==================================>---------------------------------------: 82.4\u001b[0K\u001b[1G==================================>---------------------------------------: 82.0\u001b[0K\u001b[1G==================================>---------------------------------------: 81.6\u001b[0K"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1G===================================>--------------------------------------: 81.2\u001b[0K\u001b[1G===================================>--------------------------------------: 80.8\u001b[0K\u001b[1G===================================>--------------------------------------: 80.4\u001b[0K\u001b[1G===================================>--------------------------------------: 80.0\u001b[0K\u001b[1G===================================>--------------------------------------: 79.6\u001b[0K\u001b[1G====================================>-------------------------------------: 79.2\u001b[0K\u001b[1G====================================>-------------------------------------: 78.8\u001b[0K\u001b[1G====================================>-------------------------------------: 78.5\u001b[0K\u001b[1G====================================>-------------------------------------: 78.1\u001b[0K\u001b[1G====================================>-------------------------------------: 77.7\u001b[0K\u001b[1G====================================>-------------------------------------: 77.3\u001b[0K\u001b[1G=====================================>------------------------------------: 77.0\u001b[0K\u001b[1G=====================================>------------------------------------: 76.7\u001b[0K\u001b[1G=====================================>------------------------------------: 76.3\u001b[0K\u001b[1G=====================================>------------------------------------: 75.9\u001b[0K\u001b[1G=====================================>------------------------------------: 75.5\u001b[0K\u001b[1G======================================>-----------------------------------: 75.1\u001b[0K\u001b[1G======================================>-----------------------------------: 74.7\u001b[0K\u001b[1G======================================>-----------------------------------: 74.3\u001b[0K\u001b[1G======================================>-----------------------------------: 73.9\u001b[0K\u001b[1G======================================>-----------------------------------: 73.5\u001b[0K\u001b[1G=======================================>----------------------------------: 73.1\u001b[0K\u001b[1G=======================================>----------------------------------: 72.7\u001b[0K\u001b[1G=======================================>----------------------------------: 72.3\u001b[0K\u001b[1G=======================================>----------------------------------: 72.0\u001b[0K\u001b[1G=======================================>----------------------------------: 71.6\u001b[0K\u001b[1G=======================================>----------------------------------: 71.3\u001b[0K\u001b[1G========================================>---------------------------------: 71.0\u001b[0K\u001b[1G========================================>---------------------------------: 70.5\u001b[0K\u001b[1G========================================>---------------------------------: 70.1\u001b[0K\u001b[1G========================================>---------------------------------: 69.7\u001b[0K\u001b[1G========================================>---------------------------------: 69.3\u001b[0K\u001b[1G=========================================>--------------------------------: 68.9\u001b[0K\u001b[1G=========================================>--------------------------------: 68.6\u001b[0K\u001b[1G=========================================>--------------------------------: 68.5\u001b[0K\u001b[1G=========================================>--------------------------------: 68.2\u001b[0K\u001b[1G=========================================>--------------------------------: 67.7\u001b[0K\u001b[1G=========================================>--------------------------------: 67.3\u001b[0K\u001b[1G==========================================>-------------------------------: 67.0\u001b[0K\u001b[1G==========================================>-------------------------------: 66.6\u001b[0K\u001b[1G==========================================>-------------------------------: 66.2\u001b[0K\u001b[1G==========================================>-------------------------------: 65.8\u001b[0K\u001b[1G==========================================>-------------------------------: 65.4\u001b[0K\u001b[1G===========================================>------------------------------: 65.0\u001b[0K\u001b[1G===========================================>------------------------------: 64.6\u001b[0K\u001b[1G===========================================>------------------------------: 64.2\u001b[0K\u001b[1G===========================================>------------------------------: 63.8\u001b[0K\u001b[1G===========================================>------------------------------: 63.4\u001b[0K\u001b[1G============================================>-----------------------------: 63.0\u001b[0K\u001b[1G============================================>-----------------------------: 62.6\u001b[0K\u001b[1G============================================>-----------------------------: 62.2\u001b[0K\u001b[1G============================================>-----------------------------: 61.8\u001b[0K\u001b[1G============================================>-----------------------------: 61.4\u001b[0K\u001b[1G============================================>-----------------------------: 61.0\u001b[0K\u001b[1G=============================================>----------------------------: 60.6\u001b[0K\u001b[1G=============================================>----------------------------: 60.3\u001b[0K\u001b[1G=============================================>----------------------------: 60.0\u001b[0K\u001b[1G=============================================>----------------------------: 59.6\u001b[0K\u001b[1G=============================================>----------------------------: 59.3\u001b[0K\u001b[1G==============================================>---------------------------: 59.0\u001b[0K\u001b[1G==============================================>---------------------------: 58.7\u001b[0K\u001b[1G==============================================>---------------------------: 58.4\u001b[0K\u001b[1G==============================================>---------------------------: 58.1\u001b[0K\u001b[1G==============================================>---------------------------: 57.7\u001b[0K\u001b[1G==============================================>---------------------------: 57.3\u001b[0K\u001b[1G===============================================>--------------------------: 57.0\u001b[0K\u001b[1G===============================================>--------------------------: 56.6\u001b[0K\u001b[1G===============================================>--------------------------: 56.3\u001b[0K\u001b[1G===============================================>--------------------------: 55.9\u001b[0K\u001b[1G===============================================>--------------------------: 55.5\u001b[0K\u001b[1G================================================>-------------------------: 55.1\u001b[0K\u001b[1G================================================>-------------------------: 54.8\u001b[0K\u001b[1G================================================>-------------------------: 54.4\u001b[0K\u001b[1G================================================>-------------------------: 54.1\u001b[0K\u001b[1G================================================>-------------------------: 53.7\u001b[0K\u001b[1G=================================================>------------------------: 53.3\u001b[0K\u001b[1G=================================================>------------------------: 52.9\u001b[0K\u001b[1G=================================================>------------------------: 52.6\u001b[0K\u001b[1G=================================================>------------------------: 52.2\u001b[0K\u001b[1G=================================================>------------------------: 51.8\u001b[0K\u001b[1G=================================================>------------------------: 51.4\u001b[0K\u001b[1G==================================================>-----------------------: 51.0\u001b[0K\u001b[1G==================================================>-----------------------: 50.6\u001b[0K\u001b[1G==================================================>-----------------------: 50.2\u001b[0K\u001b[1G==================================================>-----------------------: 49.9\u001b[0K\u001b[1G==================================================>-----------------------: 49.5\u001b[0K\u001b[1G===================================================>----------------------: 49.1\u001b[0K\u001b[1G===================================================>----------------------: 48.7\u001b[0K\u001b[1G===================================================>----------------------: 48.3\u001b[0K\u001b[1G===================================================>----------------------: 47.9\u001b[0K\u001b[1G===================================================>----------------------: 47.5\u001b[0K\u001b[1G===================================================>----------------------: 47.1\u001b[0K\u001b[1G====================================================>---------------------: 46.7\u001b[0K\u001b[1G====================================================>---------------------: 46.3\u001b[0K"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1G====================================================>---------------------: 45.9\u001b[0K\u001b[1G====================================================>---------------------: 45.5\u001b[0K\u001b[1G====================================================>---------------------: 45.0\u001b[0K\u001b[1G=====================================================>--------------------: 44.6\u001b[0K\u001b[1G=====================================================>--------------------: 44.2\u001b[0K\u001b[1G=====================================================>--------------------: 43.8\u001b[0K\u001b[1G=====================================================>--------------------: 43.4\u001b[0K\u001b[1G=====================================================>--------------------: 43.0\u001b[0K\u001b[1G======================================================>-------------------: 42.6\u001b[0K\u001b[1G======================================================>-------------------: 42.2\u001b[0K\u001b[1G======================================================>-------------------: 41.8\u001b[0K\u001b[1G======================================================>-------------------: 41.5\u001b[0K\u001b[1G======================================================>-------------------: 41.1\u001b[0K\u001b[1G======================================================>-------------------: 40.7\u001b[0K\u001b[1G=======================================================>------------------: 40.3\u001b[0K\u001b[1G=======================================================>------------------: 39.9\u001b[0K\u001b[1G=======================================================>------------------: 39.5\u001b[0K\u001b[1G=======================================================>------------------: 39.1\u001b[0K\u001b[1G=======================================================>------------------: 38.7\u001b[0K\u001b[1G========================================================>-----------------: 38.3\u001b[0K\u001b[1G========================================================>-----------------: 37.9\u001b[0K\u001b[1G========================================================>-----------------: 37.5\u001b[0K\u001b[1G========================================================>-----------------: 37.0\u001b[0K\u001b[1G========================================================>-----------------: 36.6\u001b[0K\u001b[1G========================================================>-----------------: 36.2\u001b[0K\u001b[1G=========================================================>----------------: 35.8\u001b[0K\u001b[1G=========================================================>----------------: 35.4\u001b[0K\u001b[1G=========================================================>----------------: 35.0\u001b[0K\u001b[1G=========================================================>----------------: 34.6\u001b[0K\u001b[1G=========================================================>----------------: 34.1\u001b[0K\u001b[1G==========================================================>---------------: 33.7\u001b[0K\u001b[1G==========================================================>---------------: 33.3\u001b[0K\u001b[1G==========================================================>---------------: 32.9\u001b[0K\u001b[1G==========================================================>---------------: 32.5\u001b[0K\u001b[1G==========================================================>---------------: 32.1\u001b[0K\u001b[1G===========================================================>--------------: 31.7\u001b[0K\u001b[1G===========================================================>--------------: 31.2\u001b[0K\u001b[1G===========================================================>--------------: 30.8\u001b[0K\u001b[1G===========================================================>--------------: 30.4\u001b[0K\u001b[1G===========================================================>--------------: 30.0\u001b[0K\u001b[1G===========================================================>--------------: 29.6\u001b[0K\u001b[1G============================================================>-------------: 29.2\u001b[0K\u001b[1G============================================================>-------------: 28.8\u001b[0K\u001b[1G============================================================>-------------: 28.4\u001b[0K\u001b[1G============================================================>-------------: 28.0\u001b[0K\u001b[1G============================================================>-------------: 27.6\u001b[0K\u001b[1G=============================================================>------------: 27.2\u001b[0K\u001b[1G=============================================================>------------: 26.8\u001b[0K\u001b[1G=============================================================>------------: 26.4\u001b[0K\u001b[1G=============================================================>------------: 26.0\u001b[0K\u001b[1G=============================================================>------------: 25.6\u001b[0K\u001b[1G==============================================================>-----------: 25.2\u001b[0K\u001b[1G==============================================================>-----------: 24.8\u001b[0K\u001b[1G==============================================================>-----------: 24.4\u001b[0K\u001b[1G==============================================================>-----------: 24.0\u001b[0K\u001b[1G==============================================================>-----------: 23.6\u001b[0K\u001b[1G==============================================================>-----------: 23.1\u001b[0K\u001b[1G===============================================================>----------: 22.7\u001b[0K\u001b[1G===============================================================>----------: 22.3\u001b[0K\u001b[1G===============================================================>----------: 21.9\u001b[0K\u001b[1G===============================================================>----------: 21.5\u001b[0K\u001b[1G===============================================================>----------: 21.1\u001b[0K\u001b[1G================================================================>---------: 20.7\u001b[0K\u001b[1G================================================================>---------: 20.3\u001b[0K\u001b[1G================================================================>---------: 19.9\u001b[0K\u001b[1G================================================================>---------: 19.5\u001b[0K\u001b[1G================================================================>---------: 19.1\u001b[0K\u001b[1G================================================================>---------: 18.7\u001b[0K\u001b[1G=================================================================>--------: 18.3\u001b[0K\u001b[1G=================================================================>--------: 17.9\u001b[0K\u001b[1G=================================================================>--------: 17.5\u001b[0K\u001b[1G=================================================================>--------: 17.1\u001b[0K\u001b[1G=================================================================>--------: 16.6\u001b[0K\u001b[1G==================================================================>-------: 16.2\u001b[0K\u001b[1G==================================================================>-------: 15.8\u001b[0K\u001b[1G==================================================================>-------: 15.4\u001b[0K\u001b[1G==================================================================>-------: 15.0\u001b[0K\u001b[1G==================================================================>-------: 14.6\u001b[0K\u001b[1G===================================================================>------: 14.2\u001b[0K\u001b[1G===================================================================>------: 13.8\u001b[0K\u001b[1G===================================================================>------: 13.4\u001b[0K\u001b[1G===================================================================>------: 13.0\u001b[0K\u001b[1G===================================================================>------: 12.6\u001b[0K\u001b[1G===================================================================>------: 12.2\u001b[0K\u001b[1G====================================================================>-----: 11.8\u001b[0K\u001b[1G====================================================================>-----: 11.4\u001b[0K\u001b[1G====================================================================>-----: 11.0\u001b[0K\u001b[1G====================================================================>-----: 10.6\u001b[0K\u001b[1G====================================================================>-----: 10.2\u001b[0K\u001b[1G=====================================================================>-----: 9.7\u001b[0K\u001b[1G======================================================================>----: 9.3\u001b[0K\u001b[1G======================================================================>----: 8.9\u001b[0K\u001b[1G======================================================================>----: 8.5\u001b[0K\u001b[1G======================================================================>----: 8.1\u001b[0K"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1G======================================================================>----: 7.7\u001b[0K\u001b[1G=======================================================================>---: 7.3\u001b[0K\u001b[1G=======================================================================>---: 6.9\u001b[0K\u001b[1G=======================================================================>---: 6.5\u001b[0K\u001b[1G=======================================================================>---: 6.1\u001b[0K\u001b[1G=======================================================================>---: 5.7\u001b[0K\u001b[1G========================================================================>--: 5.3\u001b[0K\u001b[1G========================================================================>--: 4.9\u001b[0K\u001b[1G========================================================================>--: 4.5\u001b[0K\u001b[1G========================================================================>--: 4.1\u001b[0K\u001b[1G========================================================================>--: 3.7\u001b[0K\u001b[1G========================================================================>--: 3.3\u001b[0K\u001b[1G=========================================================================>-: 2.8\u001b[0K\u001b[1G=========================================================================>-: 2.4\u001b[0K\u001b[1G=========================================================================>-: 2.0\u001b[0K\u001b[1G=========================================================================>-: 1.6\u001b[0K\u001b[1G=========================================================================>-: 1.2\u001b[0K\u001b[1G==========================================================================>: 0.8\u001b[0K\u001b[1G==========================================================================>: 0.4\u001b[0K\u001b[1G==========================================================================>: 0.0\u001b[0K\n",
      "Loss: 0.240 (train), 0.058 (val); Accuracy: 0.923 (train), 0.982 (val) (3.30 ms/step)\n",
      "\n",
      "Evaluation result:\n",
      "  Loss = 0.054; Accuracy = 0.983\n",
      "Saved model to path: /home/clive/work/seldon-core/fork-seldon-core/examples/models/nodejs_mnist/\n",
      "\n",
      "\u001b[33m\u001b[39m\n",
      "\u001b[33m   ╭───────────────────────────────────────────────────────────────╮\u001b[39m\n",
      "   \u001b[33m│\u001b[39m                                                               \u001b[33m│\u001b[39m\n",
      "   \u001b[33m│\u001b[39m       New \u001b[33mminor\u001b[39m version of npm available! \u001b[31m6.4.1\u001b[39m → \u001b[32m6.9.0\u001b[39m       \u001b[33m│\u001b[39m\n",
      "   \u001b[33m│\u001b[39m   \u001b[33mChangelog:\u001b[39m \u001b[36mhttps://github.com/npm/cli/releases/tag/v6.9.0\u001b[39m   \u001b[33m│\u001b[39m\n",
      "   \u001b[33m│\u001b[39m               Run \u001b[32mnpm install -g npm\u001b[39m to update!               \u001b[33m│\u001b[39m\n",
      "   \u001b[33m│\u001b[39m                                                               \u001b[33m│\u001b[39m\n",
      "\u001b[33m   ╰───────────────────────────────────────────────────────────────╯\u001b[39m\n",
      "\u001b[33m\u001b[39m\n",
      "rm -f *ubyte\n",
      "rm -rf node_modules\n",
      "rm -f package-lock.json\n"
     ]
    }
   ],
   "source": [
    "!make train && make clean_build"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Training creates a model.json file and a weights.bin file which is utilized for prediction"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Prediction using REST API on the docker container"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "---> Installing application source...\n",
      "---> Installing dependencies ...\n",
      "\n",
      "> @tensorflow/tfjs-node@0.1.15 install /microservice/model/node_modules/@tensorflow/tfjs-node\n",
      "> node scripts/install.js\n",
      "\n",
      "* Downloading libtensorflow\n",
      "\n",
      "* Building TensorFlow Node.js bindings\n",
      "\n",
      "> protobufjs@6.8.8 postinstall /microservice/model/node_modules/protobufjs\n",
      "> node scripts/postinstall\n",
      "\n",
      "npm notice created a lockfile as package-lock.json. You should commit this file.\n",
      "npm WARN nodejs_mnist@1.0.0 No repository field.\n",
      "npm WARN nodejs_mnist@1.0.0 No license field.\n",
      "\n",
      "added 50 packages from 58 contributors and audited 64 packages in 16.212s\n",
      "found 0 vulnerabilities\n",
      "\n",
      "Build completed successfully\n"
     ]
    }
   ],
   "source": [
    "!s2i build . seldonio/seldon-core-s2i-nodejs:0.2-SNAPSHOT node-s2i-mnist-model:0.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a41526a3110245adad542b85a8ac0c5822e35d0cb0530f3cffe46c10e421cfff\r\n"
     ]
    }
   ],
   "source": [
    "!docker run --name \"nodejs_mnist_predictor\" -d --rm -p 5000:5000 node-s2i-mnist-model:0.1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Send some random features that conform to the contract"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "----------------------------------------\r\n",
      "SENDING NEW REQUEST:\r\n",
      "\r\n",
      "[[[[0.109]\r\n",
      "   [0.536]\r\n",
      "   [0.906]\r\n",
      "   [0.169]\r\n",
      "   [0.342]\r\n",
      "   [0.662]\r\n",
      "   [0.834]\r\n",
      "   [0.724]\r\n",
      "   [0.466]\r\n",
      "   [0.199]\r\n",
      "   [0.503]\r\n",
      "   [0.502]\r\n",
      "   [0.899]\r\n",
      "   [0.761]\r\n",
      "   [0.155]\r\n",
      "   [0.105]\r\n",
      "   [0.225]\r\n",
      "   [0.296]\r\n",
      "   [0.198]\r\n",
      "   [0.917]\r\n",
      "   [0.483]\r\n",
      "   [0.881]\r\n",
      "   [0.283]\r\n",
      "   [0.919]\r\n",
      "   [0.817]\r\n",
      "   [0.509]\r\n",
      "   [0.08 ]\r\n",
      "   [0.965]]\r\n",
      "\r\n",
      "  [[0.564]\r\n",
      "   [0.931]\r\n",
      "   [0.953]\r\n",
      "   [0.001]\r\n",
      "   [0.858]\r\n",
      "   [0.332]\r\n",
      "   [0.942]\r\n",
      "   [0.699]\r\n",
      "   [0.95 ]\r\n",
      "   [0.486]\r\n",
      "   [0.876]\r\n",
      "   [0.727]\r\n",
      "   [0.163]\r\n",
      "   [0.535]\r\n",
      "   [0.881]\r\n",
      "   [0.937]\r\n",
      "   [0.369]\r\n",
      "   [0.556]\r\n",
      "   [0.985]\r\n",
      "   [0.574]\r\n",
      "   [0.022]\r\n",
      "   [0.835]\r\n",
      "   [0.174]\r\n",
      "   [0.615]\r\n",
      "   [0.041]\r\n",
      "   [0.916]\r\n",
      "   [0.619]\r\n",
      "   [0.342]]\r\n",
      "\r\n",
      "  [[0.874]\r\n",
      "   [0.522]\r\n",
      "   [0.911]\r\n",
      "   [0.163]\r\n",
      "   [0.341]\r\n",
      "   [0.233]\r\n",
      "   [0.626]\r\n",
      "   [0.528]\r\n",
      "   [0.194]\r\n",
      "   [0.566]\r\n",
      "   [0.644]\r\n",
      "   [0.897]\r\n",
      "   [0.659]\r\n",
      "   [0.065]\r\n",
      "   [0.383]\r\n",
      "   [0.778]\r\n",
      "   [0.746]\r\n",
      "   [0.492]\r\n",
      "   [0.496]\r\n",
      "   [0.628]\r\n",
      "   [0.245]\r\n",
      "   [0.07 ]\r\n",
      "   [0.647]\r\n",
      "   [0.159]\r\n",
      "   [0.97 ]\r\n",
      "   [0.407]\r\n",
      "   [0.395]\r\n",
      "   [0.4  ]]\r\n",
      "\r\n",
      "  [[0.466]\r\n",
      "   [0.914]\r\n",
      "   [0.617]\r\n",
      "   [0.202]\r\n",
      "   [0.285]\r\n",
      "   [0.183]\r\n",
      "   [0.137]\r\n",
      "   [0.952]\r\n",
      "   [0.608]\r\n",
      "   [0.434]\r\n",
      "   [0.89 ]\r\n",
      "   [0.293]\r\n",
      "   [0.555]\r\n",
      "   [0.034]\r\n",
      "   [0.988]\r\n",
      "   [0.548]\r\n",
      "   [0.743]\r\n",
      "   [0.066]\r\n",
      "   [0.683]\r\n",
      "   [0.205]\r\n",
      "   [0.739]\r\n",
      "   [0.205]\r\n",
      "   [0.35 ]\r\n",
      "   [0.297]\r\n",
      "   [0.918]\r\n",
      "   [0.928]\r\n",
      "   [0.562]\r\n",
      "   [0.747]]\r\n",
      "\r\n",
      "  [[0.143]\r\n",
      "   [0.686]\r\n",
      "   [0.432]\r\n",
      "   [0.701]\r\n",
      "   [0.243]\r\n",
      "   [0.503]\r\n",
      "   [0.469]\r\n",
      "   [0.553]\r\n",
      "   [0.206]\r\n",
      "   [0.444]\r\n",
      "   [0.065]\r\n",
      "   [0.711]\r\n",
      "   [0.614]\r\n",
      "   [0.722]\r\n",
      "   [0.885]\r\n",
      "   [0.754]\r\n",
      "   [0.594]\r\n",
      "   [0.124]\r\n",
      "   [0.455]\r\n",
      "   [0.276]\r\n",
      "   [0.363]\r\n",
      "   [0.125]\r\n",
      "   [0.41 ]\r\n",
      "   [0.078]\r\n",
      "   [0.902]\r\n",
      "   [0.321]\r\n",
      "   [0.279]\r\n",
      "   [0.164]]\r\n",
      "\r\n",
      "  [[0.903]\r\n",
      "   [0.556]\r\n",
      "   [0.266]\r\n",
      "   [0.927]\r\n",
      "   [0.958]\r\n",
      "   [0.2  ]\r\n",
      "   [0.095]\r\n",
      "   [0.761]\r\n",
      "   [0.419]\r\n",
      "   [0.047]\r\n",
      "   [0.055]\r\n",
      "   [0.831]\r\n",
      "   [0.527]\r\n",
      "   [0.404]\r\n",
      "   [0.512]\r\n",
      "   [0.653]\r\n",
      "   [0.652]\r\n",
      "   [0.325]\r\n",
      "   [0.456]\r\n",
      "   [0.681]\r\n",
      "   [0.791]\r\n",
      "   [0.601]\r\n",
      "   [0.514]\r\n",
      "   [0.255]\r\n",
      "   [0.415]\r\n",
      "   [0.831]\r\n",
      "   [0.394]\r\n",
      "   [0.02 ]]\r\n",
      "\r\n",
      "  [[0.904]\r\n",
      "   [0.89 ]\r\n",
      "   [0.793]\r\n",
      "   [0.342]\r\n",
      "   [0.125]\r\n",
      "   [0.039]\r\n",
      "   [0.423]\r\n",
      "   [0.714]\r\n",
      "   [0.546]\r\n",
      "   [0.299]\r\n",
      "   [0.902]\r\n",
      "   [0.717]\r\n",
      "   [0.507]\r\n",
      "   [0.355]\r\n",
      "   [0.174]\r\n",
      "   [0.836]\r\n",
      "   [0.473]\r\n",
      "   [0.635]\r\n",
      "   [0.887]\r\n",
      "   [0.755]\r\n",
      "   [0.62 ]\r\n",
      "   [0.508]\r\n",
      "   [0.479]\r\n",
      "   [0.915]\r\n",
      "   [0.1  ]\r\n",
      "   [0.665]\r\n",
      "   [0.148]\r\n",
      "   [0.421]]\r\n",
      "\r\n",
      "  [[0.724]\r\n",
      "   [0.336]\r\n",
      "   [0.596]\r\n",
      "   [0.432]\r\n",
      "   [0.848]\r\n",
      "   [0.737]\r\n",
      "   [0.971]\r\n",
      "   [0.408]\r\n",
      "   [0.395]\r\n",
      "   [0.371]\r\n",
      "   [0.588]\r\n",
      "   [0.778]\r\n",
      "   [0.428]\r\n",
      "   [0.687]\r\n",
      "   [0.534]\r\n",
      "   [0.427]\r\n",
      "   [0.723]\r\n",
      "   [0.161]\r\n",
      "   [0.532]\r\n",
      "   [0.739]\r\n",
      "   [0.855]\r\n",
      "   [0.37 ]\r\n",
      "   [0.512]\r\n",
      "   [0.862]\r\n",
      "   [0.061]\r\n",
      "   [0.817]\r\n",
      "   [0.768]\r\n",
      "   [0.735]]\r\n",
      "\r\n",
      "  [[0.464]\r\n",
      "   [0.604]\r\n",
      "   [0.541]\r\n",
      "   [0.349]\r\n",
      "   [0.102]\r\n",
      "   [0.704]\r\n",
      "   [0.24 ]\r\n",
      "   [0.38 ]\r\n",
      "   [0.884]\r\n",
      "   [0.131]\r\n",
      "   [0.944]\r\n",
      "   [0.494]\r\n",
      "   [0.794]\r\n",
      "   [0.934]\r\n",
      "   [0.81 ]\r\n",
      "   [0.015]\r\n",
      "   [0.612]\r\n",
      "   [0.399]\r\n",
      "   [0.484]\r\n",
      "   [0.18 ]\r\n",
      "   [0.596]\r\n",
      "   [0.347]\r\n",
      "   [0.582]\r\n",
      "   [0.47 ]\r\n",
      "   [0.759]\r\n",
      "   [0.232]\r\n",
      "   [0.827]\r\n",
      "   [0.635]]\r\n",
      "\r\n",
      "  [[0.362]\r\n",
      "   [0.976]\r\n",
      "   [0.588]\r\n",
      "   [0.466]\r\n",
      "   [0.371]\r\n",
      "   [0.139]\r\n",
      "   [0.201]\r\n",
      "   [0.927]\r\n",
      "   [0.998]\r\n",
      "   [0.063]\r\n",
      "   [0.439]\r\n",
      "   [0.483]\r\n",
      "   [0.07 ]\r\n",
      "   [0.478]\r\n",
      "   [0.827]\r\n",
      "   [0.77 ]\r\n",
      "   [0.971]\r\n",
      "   [0.318]\r\n",
      "   [0.42 ]\r\n",
      "   [0.835]\r\n",
      "   [0.751]\r\n",
      "   [0.84 ]\r\n",
      "   [0.838]\r\n",
      "   [0.654]\r\n",
      "   [0.204]\r\n",
      "   [0.153]\r\n",
      "   [0.441]\r\n",
      "   [0.015]]\r\n",
      "\r\n",
      "  [[0.489]\r\n",
      "   [0.252]\r\n",
      "   [0.   ]\r\n",
      "   [0.417]\r\n",
      "   [0.92 ]\r\n",
      "   [0.442]\r\n",
      "   [0.307]\r\n",
      "   [0.073]\r\n",
      "   [0.784]\r\n",
      "   [0.481]\r\n",
      "   [0.154]\r\n",
      "   [0.334]\r\n",
      "   [0.276]\r\n",
      "   [0.163]\r\n",
      "   [0.156]\r\n",
      "   [0.145]\r\n",
      "   [0.348]\r\n",
      "   [0.356]\r\n",
      "   [0.276]\r\n",
      "   [0.68 ]\r\n",
      "   [0.431]\r\n",
      "   [0.238]\r\n",
      "   [0.404]\r\n",
      "   [0.284]\r\n",
      "   [0.848]\r\n",
      "   [0.865]\r\n",
      "   [0.052]\r\n",
      "   [0.433]]\r\n",
      "\r\n",
      "  [[0.19 ]\r\n",
      "   [0.266]\r\n",
      "   [0.835]\r\n",
      "   [0.469]\r\n",
      "   [0.808]\r\n",
      "   [0.189]\r\n",
      "   [0.424]\r\n",
      "   [0.127]\r\n",
      "   [0.766]\r\n",
      "   [0.638]\r\n",
      "   [0.283]\r\n",
      "   [0.494]\r\n",
      "   [0.459]\r\n",
      "   [0.299]\r\n",
      "   [0.764]\r\n",
      "   [0.368]\r\n",
      "   [0.248]\r\n",
      "   [0.28 ]\r\n",
      "   [0.328]\r\n",
      "   [0.356]\r\n",
      "   [0.083]\r\n",
      "   [0.067]\r\n",
      "   [0.616]\r\n",
      "   [0.994]\r\n",
      "   [0.683]\r\n",
      "   [0.975]\r\n",
      "   [0.96 ]\r\n",
      "   [0.706]]\r\n",
      "\r\n",
      "  [[0.198]\r\n",
      "   [0.879]\r\n",
      "   [0.205]\r\n",
      "   [0.14 ]\r\n",
      "   [0.251]\r\n",
      "   [0.814]\r\n",
      "   [0.808]\r\n",
      "   [0.61 ]\r\n",
      "   [0.762]\r\n",
      "   [0.847]\r\n",
      "   [0.115]\r\n",
      "   [0.894]\r\n",
      "   [0.043]\r\n",
      "   [0.342]\r\n",
      "   [0.967]\r\n",
      "   [0.269]\r\n",
      "   [0.507]\r\n",
      "   [0.072]\r\n",
      "   [0.126]\r\n",
      "   [0.091]\r\n",
      "   [0.023]\r\n",
      "   [0.917]\r\n",
      "   [0.984]\r\n",
      "   [0.007]\r\n",
      "   [0.668]\r\n",
      "   [0.992]\r\n",
      "   [0.846]\r\n",
      "   [0.062]]\r\n",
      "\r\n",
      "  [[0.786]\r\n",
      "   [0.823]\r\n",
      "   [0.279]\r\n",
      "   [0.888]\r\n",
      "   [0.02 ]\r\n",
      "   [0.12 ]\r\n",
      "   [0.56 ]\r\n",
      "   [0.383]\r\n",
      "   [0.08 ]\r\n",
      "   [0.013]\r\n",
      "   [0.525]\r\n",
      "   [0.078]\r\n",
      "   [0.012]\r\n",
      "   [0.242]\r\n",
      "   [0.162]\r\n",
      "   [0.088]\r\n",
      "   [0.359]\r\n",
      "   [0.276]\r\n",
      "   [0.968]\r\n",
      "   [0.219]\r\n",
      "   [0.441]\r\n",
      "   [0.957]\r\n",
      "   [0.954]\r\n",
      "   [0.779]\r\n",
      "   [0.419]\r\n",
      "   [0.109]\r\n",
      "   [0.312]\r\n",
      "   [0.708]]\r\n",
      "\r\n",
      "  [[0.993]\r\n",
      "   [0.588]\r\n",
      "   [0.856]\r\n",
      "   [0.924]\r\n",
      "   [0.43 ]\r\n",
      "   [0.725]\r\n",
      "   [0.285]\r\n",
      "   [0.961]\r\n",
      "   [0.251]\r\n",
      "   [0.631]\r\n",
      "   [0.458]\r\n",
      "   [0.416]\r\n",
      "   [0.478]\r\n",
      "   [0.872]\r\n",
      "   [0.833]\r\n",
      "   [0.285]\r\n",
      "   [0.28 ]\r\n",
      "   [0.669]\r\n",
      "   [0.589]\r\n",
      "   [0.238]\r\n",
      "   [0.467]\r\n",
      "   [0.706]\r\n",
      "   [0.067]\r\n",
      "   [0.665]\r\n",
      "   [0.397]\r\n",
      "   [0.021]\r\n",
      "   [0.597]\r\n",
      "   [0.76 ]]\r\n",
      "\r\n",
      "  [[0.057]\r\n",
      "   [0.769]\r\n",
      "   [0.938]\r\n",
      "   [0.901]\r\n",
      "   [0.288]\r\n",
      "   [0.145]\r\n",
      "   [0.305]\r\n",
      "   [0.275]\r\n",
      "   [0.222]\r\n",
      "   [0.04 ]\r\n",
      "   [0.84 ]\r\n",
      "   [0.734]\r\n",
      "   [0.329]\r\n",
      "   [0.106]\r\n",
      "   [0.879]\r\n",
      "   [0.876]\r\n",
      "   [0.245]\r\n",
      "   [0.179]\r\n",
      "   [0.892]\r\n",
      "   [0.731]\r\n",
      "   [0.08 ]\r\n",
      "   [0.307]\r\n",
      "   [0.368]\r\n",
      "   [0.668]\r\n",
      "   [0.673]\r\n",
      "   [0.867]\r\n",
      "   [0.187]\r\n",
      "   [0.583]]\r\n",
      "\r\n",
      "  [[0.393]\r\n",
      "   [0.241]\r\n",
      "   [0.192]\r\n",
      "   [0.787]\r\n",
      "   [0.469]\r\n",
      "   [0.128]\r\n",
      "   [0.006]\r\n",
      "   [0.271]\r\n",
      "   [0.013]\r\n",
      "   [0.79 ]\r\n",
      "   [0.447]\r\n",
      "   [0.557]\r\n",
      "   [0.844]\r\n",
      "   [0.303]\r\n",
      "   [0.628]\r\n",
      "   [0.339]\r\n",
      "   [0.413]\r\n",
      "   [0.441]\r\n",
      "   [0.538]\r\n",
      "   [0.235]\r\n",
      "   [0.241]\r\n",
      "   [0.229]\r\n",
      "   [0.228]\r\n",
      "   [0.374]\r\n",
      "   [0.433]\r\n",
      "   [0.838]\r\n",
      "   [0.922]\r\n",
      "   [0.24 ]]\r\n",
      "\r\n",
      "  [[0.903]\r\n",
      "   [0.151]\r\n",
      "   [0.391]\r\n",
      "   [0.079]\r\n",
      "   [0.574]\r\n",
      "   [0.94 ]\r\n",
      "   [0.742]\r\n",
      "   [0.677]\r\n",
      "   [0.622]\r\n",
      "   [0.969]\r\n",
      "   [0.9  ]\r\n",
      "   [0.785]\r\n",
      "   [0.271]\r\n",
      "   [0.373]\r\n",
      "   [0.253]\r\n",
      "   [0.03 ]\r\n",
      "   [0.771]\r\n",
      "   [0.717]\r\n",
      "   [0.483]\r\n",
      "   [0.004]\r\n",
      "   [0.939]\r\n",
      "   [0.301]\r\n",
      "   [0.208]\r\n",
      "   [0.081]\r\n",
      "   [0.282]\r\n",
      "   [0.288]\r\n",
      "   [0.253]\r\n",
      "   [0.556]]\r\n",
      "\r\n",
      "  [[0.324]\r\n",
      "   [0.683]\r\n",
      "   [0.038]\r\n",
      "   [0.487]\r\n",
      "   [0.537]\r\n",
      "   [0.955]\r\n",
      "   [0.901]\r\n",
      "   [0.862]\r\n",
      "   [0.846]\r\n",
      "   [0.544]\r\n",
      "   [0.844]\r\n",
      "   [0.451]\r\n",
      "   [0.234]\r\n",
      "   [0.34 ]\r\n",
      "   [0.739]\r\n",
      "   [0.18 ]\r\n",
      "   [0.958]\r\n",
      "   [0.674]\r\n",
      "   [0.443]\r\n",
      "   [0.389]\r\n",
      "   [0.762]\r\n",
      "   [0.836]\r\n",
      "   [0.868]\r\n",
      "   [0.437]\r\n",
      "   [0.976]\r\n",
      "   [0.478]\r\n",
      "   [0.018]\r\n",
      "   [0.971]]\r\n",
      "\r\n",
      "  [[0.062]\r\n",
      "   [0.232]\r\n",
      "   [0.729]\r\n",
      "   [0.697]\r\n",
      "   [0.257]\r\n",
      "   [0.599]\r\n",
      "   [0.503]\r\n",
      "   [0.49 ]\r\n",
      "   [0.046]\r\n",
      "   [0.781]\r\n",
      "   [0.222]\r\n",
      "   [0.566]\r\n",
      "   [0.329]\r\n",
      "   [0.379]\r\n",
      "   [0.951]\r\n",
      "   [0.421]\r\n",
      "   [0.57 ]\r\n",
      "   [0.333]\r\n",
      "   [0.18 ]\r\n",
      "   [0.96 ]\r\n",
      "   [0.156]\r\n",
      "   [0.116]\r\n",
      "   [0.112]\r\n",
      "   [0.063]\r\n",
      "   [0.348]\r\n",
      "   [0.878]\r\n",
      "   [0.251]\r\n",
      "   [0.041]]\r\n",
      "\r\n",
      "  [[0.535]\r\n",
      "   [0.085]\r\n",
      "   [0.914]\r\n",
      "   [0.981]\r\n",
      "   [0.593]\r\n",
      "   [0.098]\r\n",
      "   [0.129]\r\n",
      "   [0.803]\r\n",
      "   [0.457]\r\n",
      "   [0.177]\r\n",
      "   [0.062]\r\n",
      "   [0.26 ]\r\n",
      "   [0.074]\r\n",
      "   [0.865]\r\n",
      "   [0.092]\r\n",
      "   [0.607]\r\n",
      "   [0.725]\r\n",
      "   [0.402]\r\n",
      "   [0.486]\r\n",
      "   [0.392]\r\n",
      "   [0.983]\r\n",
      "   [0.715]\r\n",
      "   [0.511]\r\n",
      "   [0.334]\r\n",
      "   [0.595]\r\n",
      "   [0.875]\r\n",
      "   [0.553]\r\n",
      "   [0.619]]\r\n",
      "\r\n",
      "  [[0.336]\r\n",
      "   [0.758]\r\n",
      "   [0.818]\r\n",
      "   [0.907]\r\n",
      "   [0.41 ]\r\n",
      "   [0.397]\r\n",
      "   [0.013]\r\n",
      "   [0.874]\r\n",
      "   [0.312]\r\n",
      "   [0.242]\r\n",
      "   [0.939]\r\n",
      "   [0.318]\r\n",
      "   [0.985]\r\n",
      "   [0.135]\r\n",
      "   [0.115]\r\n",
      "   [0.92 ]\r\n",
      "   [0.223]\r\n",
      "   [0.166]\r\n",
      "   [0.737]\r\n",
      "   [0.023]\r\n",
      "   [0.588]\r\n",
      "   [0.995]\r\n",
      "   [0.57 ]\r\n",
      "   [0.376]\r\n",
      "   [0.367]\r\n",
      "   [0.278]\r\n",
      "   [0.387]\r\n",
      "   [0.406]]\r\n",
      "\r\n",
      "  [[0.783]\r\n",
      "   [0.672]\r\n",
      "   [0.019]\r\n",
      "   [0.94 ]\r\n",
      "   [0.839]\r\n",
      "   [0.976]\r\n",
      "   [0.604]\r\n",
      "   [0.692]\r\n",
      "   [0.859]\r\n",
      "   [0.383]\r\n",
      "   [0.601]\r\n",
      "   [0.247]\r\n",
      "   [0.983]\r\n",
      "   [0.84 ]\r\n",
      "   [0.94 ]\r\n",
      "   [0.227]\r\n",
      "   [0.395]\r\n",
      "   [0.424]\r\n",
      "   [0.342]\r\n",
      "   [0.01 ]\r\n",
      "   [0.2  ]\r\n",
      "   [0.077]\r\n",
      "   [0.047]\r\n",
      "   [0.024]\r\n",
      "   [0.678]\r\n",
      "   [0.862]\r\n",
      "   [0.958]\r\n",
      "   [0.209]]\r\n",
      "\r\n",
      "  [[0.484]\r\n",
      "   [0.186]\r\n",
      "   [0.686]\r\n",
      "   [0.531]\r\n",
      "   [0.487]\r\n",
      "   [0.642]\r\n",
      "   [0.717]\r\n",
      "   [0.178]\r\n",
      "   [0.537]\r\n",
      "   [0.681]\r\n",
      "   [0.895]\r\n",
      "   [0.645]\r\n",
      "   [0.365]\r\n",
      "   [0.943]\r\n",
      "   [0.786]\r\n",
      "   [0.346]\r\n",
      "   [0.505]\r\n",
      "   [0.576]\r\n",
      "   [0.224]\r\n",
      "   [0.984]\r\n",
      "   [0.823]\r\n",
      "   [0.361]\r\n",
      "   [0.7  ]\r\n",
      "   [0.111]\r\n",
      "   [0.651]\r\n",
      "   [0.986]\r\n",
      "   [0.083]\r\n",
      "   [0.367]]\r\n",
      "\r\n",
      "  [[0.858]\r\n",
      "   [0.919]\r\n",
      "   [0.071]\r\n",
      "   [0.45 ]\r\n",
      "   [0.41 ]\r\n",
      "   [0.162]\r\n",
      "   [0.586]\r\n",
      "   [0.842]\r\n",
      "   [0.667]\r\n",
      "   [0.902]\r\n",
      "   [0.97 ]\r\n",
      "   [0.606]\r\n",
      "   [0.873]\r\n",
      "   [0.804]\r\n",
      "   [0.403]\r\n",
      "   [0.805]\r\n",
      "   [0.386]\r\n",
      "   [0.311]\r\n",
      "   [0.282]\r\n",
      "   [0.913]\r\n",
      "   [0.528]\r\n",
      "   [0.118]\r\n",
      "   [0.851]\r\n",
      "   [0.371]\r\n",
      "   [0.784]\r\n",
      "   [0.736]\r\n",
      "   [0.053]\r\n",
      "   [0.819]]\r\n",
      "\r\n",
      "  [[0.457]\r\n",
      "   [0.274]\r\n",
      "   [0.906]\r\n",
      "   [0.006]\r\n",
      "   [0.008]\r\n",
      "   [0.772]\r\n",
      "   [0.657]\r\n",
      "   [0.84 ]\r\n",
      "   [0.022]\r\n",
      "   [0.08 ]\r\n",
      "   [0.643]\r\n",
      "   [0.808]\r\n",
      "   [0.732]\r\n",
      "   [0.681]\r\n",
      "   [0.778]\r\n",
      "   [0.664]\r\n",
      "   [0.248]\r\n",
      "   [0.254]\r\n",
      "   [0.066]\r\n",
      "   [0.527]\r\n",
      "   [0.126]\r\n",
      "   [0.297]\r\n",
      "   [0.891]\r\n",
      "   [0.836]\r\n",
      "   [0.276]\r\n",
      "   [0.478]\r\n",
      "   [0.96 ]\r\n",
      "   [0.263]]\r\n",
      "\r\n",
      "  [[0.841]\r\n",
      "   [0.094]\r\n",
      "   [0.367]\r\n",
      "   [0.519]\r\n",
      "   [0.811]\r\n",
      "   [0.803]\r\n",
      "   [0.63 ]\r\n",
      "   [0.704]\r\n",
      "   [0.92 ]\r\n",
      "   [0.963]\r\n",
      "   [0.497]\r\n",
      "   [0.833]\r\n",
      "   [0.606]\r\n",
      "   [0.136]\r\n",
      "   [0.209]\r\n",
      "   [0.191]\r\n",
      "   [0.764]\r\n",
      "   [0.143]\r\n",
      "   [0.22 ]\r\n",
      "   [0.787]\r\n",
      "   [0.365]\r\n",
      "   [0.428]\r\n",
      "   [0.952]\r\n",
      "   [0.994]\r\n",
      "   [0.287]\r\n",
      "   [0.164]\r\n",
      "   [0.096]\r\n",
      "   [0.413]]\r\n",
      "\r\n",
      "  [[0.014]\r\n",
      "   [0.904]\r\n",
      "   [0.188]\r\n",
      "   [0.77 ]\r\n",
      "   [0.85 ]\r\n",
      "   [0.858]\r\n",
      "   [0.674]\r\n",
      "   [0.679]\r\n",
      "   [0.377]\r\n",
      "   [0.581]\r\n",
      "   [0.286]\r\n",
      "   [0.742]\r\n",
      "   [0.862]\r\n",
      "   [0.113]\r\n",
      "   [0.4  ]\r\n",
      "   [0.047]\r\n",
      "   [0.53 ]\r\n",
      "   [0.958]\r\n",
      "   [0.673]\r\n",
      "   [0.499]\r\n",
      "   [0.504]\r\n",
      "   [0.041]\r\n",
      "   [0.011]\r\n",
      "   [0.252]\r\n",
      "   [0.781]\r\n",
      "   [0.142]\r\n",
      "   [0.783]\r\n",
      "   [0.933]]]]\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "RECEIVED RESPONSE:\r\n",
      "data {\r\n",
      "  names: \"t:0\"\r\n",
      "  names: \"t:1\"\r\n",
      "  names: \"t:2\"\r\n",
      "  names: \"t:3\"\r\n",
      "  names: \"t:4\"\r\n",
      "  names: \"t:5\"\r\n",
      "  names: \"t:6\"\r\n",
      "  names: \"t:7\"\r\n",
      "  names: \"t:8\"\r\n",
      "  names: \"t:9\"\r\n",
      "  tensor {\r\n",
      "    shape: 1\r\n",
      "    shape: 10\r\n",
      "    values: 0.019353602081537247\r\n",
      "    values: 0.022517181932926178\r\n",
      "    values: 0.3373313546180725\r\n",
      "    values: 0.0516216903924942\r\n",
      "    values: 0.010216832160949707\r\n",
      "    values: 0.03270014375448227\r\n",
      "    values: 0.025425242260098457\r\n",
      "    values: 0.02032855898141861\r\n",
      "    values: 0.46700385212898254\r\n",
      "    values: 0.013501551002264023\r\n",
      "  }\r\n",
      "}\r\n",
      "\r\n",
      "\r\n"
     ]
    }
   ],
   "source": [
    "!seldon-core-tester contract.json 0.0.0.0 5000 -p -t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "nodejs_mnist_predictor\r\n"
     ]
    }
   ],
   "source": [
    "!docker rm nodejs_mnist_predictor --force"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Prediction using GRPC API on the docker container"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "---> Installing application source...\n",
      "---> Installing dependencies ...\n",
      "\n",
      "> @tensorflow/tfjs-node@0.1.15 install /microservice/model/node_modules/@tensorflow/tfjs-node\n",
      "> node scripts/install.js\n",
      "\n",
      "* Downloading libtensorflow\n",
      "\n",
      "* Building TensorFlow Node.js bindings\n",
      "\n",
      "> protobufjs@6.8.8 postinstall /microservice/model/node_modules/protobufjs\n",
      "> node scripts/postinstall\n",
      "\n",
      "npm notice created a lockfile as package-lock.json. You should commit this file.\n",
      "npm WARN nodejs_mnist@1.0.0 No repository field.\n",
      "npm WARN nodejs_mnist@1.0.0 No license field.\n",
      "\n",
      "added 50 packages from 57 contributors and audited 64 packages in 8.297s\n",
      "found 0 vulnerabilities\n",
      "\n",
      "Build completed successfully\n"
     ]
    }
   ],
   "source": [
    "!s2i build -E ./.s2i/environment_grpc . seldonio/seldon-core-s2i-nodejs:0.2-SNAPSHOT node-s2i-mnist-model:0.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7059dc3cd930b287c0eff2649034e338ddbaff4ce868c9fc695428bd426c04bd\r\n"
     ]
    }
   ],
   "source": [
    "!docker run --name \"nodejs_mnist_predictor\" -d --rm -p 5000:5000 node-s2i-mnist-model:0.2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Send some random features that conform to the contract"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "----------------------------------------\n",
      "SENDING NEW REQUEST:\n",
      "RECEIVED RESPONSE:\n",
      "Success:True message:\n",
      "Request:\n",
      "data {\n",
      "  tensor {\n",
      "    shape: 1\n",
      "    shape: 28\n",
      "    shape: 28\n",
      "    shape: 1\n",
      "    values: 0.401\n",
      "    values: 0.774\n",
      "    values: 0.944\n",
      "    values: 0.816\n",
      "    values: 0.069\n",
      "    values: 0.403\n",
      "    values: 0.572\n",
      "    values: 0.724\n",
      "    values: 0.972\n",
      "    values: 0.433\n",
      "    values: 0.697\n",
      "    values: 0.868\n",
      "    values: 0.523\n",
      "    values: 0.937\n",
      "    values: 0.06\n",
      "    values: 0.921\n",
      "    values: 0.726\n",
      "    values: 0.336\n",
      "    values: 0.635\n",
      "    values: 0.242\n",
      "    values: 0.648\n",
      "    values: 0.104\n",
      "    values: 0.615\n",
      "    values: 0.873\n",
      "    values: 0.224\n",
      "    values: 0.88\n",
      "    values: 0.99\n",
      "    values: 0.92\n",
      "    values: 0.234\n",
      "    values: 0.723\n",
      "    values: 0.462\n",
      "    values: 0.346\n",
      "    values: 0.034\n",
      "    values: 0.037\n",
      "    values: 0.426\n",
      "    values: 0.656\n",
      "    values: 0.24\n",
      "    values: 0.375\n",
      "    values: 0.818\n",
      "    values: 0.998\n",
      "    values: 0.129\n",
      "    values: 0.108\n",
      "    values: 0.1\n",
      "    values: 0.633\n",
      "    values: 0.518\n",
      "    values: 0.742\n",
      "    values: 0.248\n",
      "    values: 0.671\n",
      "    values: 0.898\n",
      "    values: 0.59\n",
      "    values: 0.414\n",
      "    values: 0.749\n",
      "    values: 0.639\n",
      "    values: 0.974\n",
      "    values: 0.218\n",
      "    values: 0.021\n",
      "    values: 0.82\n",
      "    values: 0.944\n",
      "    values: 0.249\n",
      "    values: 0.678\n",
      "    values: 0.638\n",
      "    values: 0.427\n",
      "    values: 0.64\n",
      "    values: 0.94\n",
      "    values: 0.976\n",
      "    values: 0.151\n",
      "    values: 0.056\n",
      "    values: 0.439\n",
      "    values: 0.955\n",
      "    values: 0.604\n",
      "    values: 0.968\n",
      "    values: 0.192\n",
      "    values: 0.036\n",
      "    values: 0.279\n",
      "    values: 0.947\n",
      "    values: 0.955\n",
      "    values: 0.93\n",
      "    values: 0.707\n",
      "    values: 0.579\n",
      "    values: 0.373\n",
      "    values: 0.636\n",
      "    values: 0.628\n",
      "    values: 0.052\n",
      "    values: 0.755\n",
      "    values: 0.111\n",
      "    values: 0.03\n",
      "    values: 0.429\n",
      "    values: 0.585\n",
      "    values: 0.658\n",
      "    values: 0.661\n",
      "    values: 0.732\n",
      "    values: 0.705\n",
      "    values: 0.358\n",
      "    values: 0.8\n",
      "    values: 0.13\n",
      "    values: 0.471\n",
      "    values: 0.477\n",
      "    values: 0.267\n",
      "    values: 0.511\n",
      "    values: 0.913\n",
      "    values: 0.497\n",
      "    values: 0.242\n",
      "    values: 0.869\n",
      "    values: 0.171\n",
      "    values: 0.774\n",
      "    values: 0.42\n",
      "    values: 0.778\n",
      "    values: 0.253\n",
      "    values: 0.309\n",
      "    values: 0.552\n",
      "    values: 0.233\n",
      "    values: 0.199\n",
      "    values: 0.941\n",
      "    values: 0.731\n",
      "    values: 0.917\n",
      "    values: 0.435\n",
      "    values: 0.26\n",
      "    values: 0.578\n",
      "    values: 0.365\n",
      "    values: 0.261\n",
      "    values: 0.348\n",
      "    values: 0.725\n",
      "    values: 0.428\n",
      "    values: 0.987\n",
      "    values: 0.157\n",
      "    values: 0.048\n",
      "    values: 0.457\n",
      "    values: 0.529\n",
      "    values: 0.883\n",
      "    values: 0.999\n",
      "    values: 0.763\n",
      "    values: 0.575\n",
      "    values: 0.519\n",
      "    values: 0.979\n",
      "    values: 0.979\n",
      "    values: 0.408\n",
      "    values: 0.096\n",
      "    values: 0.352\n",
      "    values: 0.21\n",
      "    values: 0.977\n",
      "    values: 0.669\n",
      "    values: 0.826\n",
      "    values: 0.466\n",
      "    values: 0.081\n",
      "    values: 0.612\n",
      "    values: 0.421\n",
      "    values: 0.972\n",
      "    values: 0.407\n",
      "    values: 0.288\n",
      "    values: 0.725\n",
      "    values: 0.153\n",
      "    values: 0.508\n",
      "    values: 0.989\n",
      "    values: 0.718\n",
      "    values: 0.797\n",
      "    values: 0.973\n",
      "    values: 0.968\n",
      "    values: 0.729\n",
      "    values: 0.229\n",
      "    values: 0.44\n",
      "    values: 0.842\n",
      "    values: 0.971\n",
      "    values: 0.472\n",
      "    values: 0.238\n",
      "    values: 0.611\n",
      "    values: 0.68\n",
      "    values: 0.36\n",
      "    values: 0.16\n",
      "    values: 0.905\n",
      "    values: 0.869\n",
      "    values: 0.545\n",
      "    values: 0.09\n",
      "    values: 0.837\n",
      "    values: 0.699\n",
      "    values: 0.113\n",
      "    values: 0.735\n",
      "    values: 0.201\n",
      "    values: 0.241\n",
      "    values: 0.527\n",
      "    values: 0.227\n",
      "    values: 0.702\n",
      "    values: 0.026\n",
      "    values: 0.532\n",
      "    values: 0.93\n",
      "    values: 0.982\n",
      "    values: 0.446\n",
      "    values: 0.103\n",
      "    values: 0.926\n",
      "    values: 0.335\n",
      "    values: 0.591\n",
      "    values: 0.013\n",
      "    values: 0.107\n",
      "    values: 0.973\n",
      "    values: 0.97\n",
      "    values: 0.476\n",
      "    values: 0.038\n",
      "    values: 0.501\n",
      "    values: 0.633\n",
      "    values: 0.075\n",
      "    values: 0.965\n",
      "    values: 0.161\n",
      "    values: 0.383\n",
      "    values: 0.336\n",
      "    values: 0.415\n",
      "    values: 0.482\n",
      "    values: 0.822\n",
      "    values: 0.36\n",
      "    values: 0.452\n",
      "    values: 0.913\n",
      "    values: 0.346\n",
      "    values: 0.873\n",
      "    values: 0.282\n",
      "    values: 0.225\n",
      "    values: 0.924\n",
      "    values: 0.458\n",
      "    values: 0.79\n",
      "    values: 0.861\n",
      "    values: 0.813\n",
      "    values: 0.762\n",
      "    values: 0.394\n",
      "    values: 0.893\n",
      "    values: 0.038\n",
      "    values: 0.327\n",
      "    values: 0.397\n",
      "    values: 0.296\n",
      "    values: 0.681\n",
      "    values: 0.68\n",
      "    values: 0.088\n",
      "    values: 0.058\n",
      "    values: 0.942\n",
      "    values: 0.483\n",
      "    values: 0.689\n",
      "    values: 0.09\n",
      "    values: 0.217\n",
      "    values: 0.263\n",
      "    values: 0.872\n",
      "    values: 0.407\n",
      "    values: 0.322\n",
      "    values: 0.875\n",
      "    values: 0.019\n",
      "    values: 0.796\n",
      "    values: 0.492\n",
      "    values: 0.71\n",
      "    values: 0.122\n",
      "    values: 0.725\n",
      "    values: 0.164\n",
      "    values: 0.555\n",
      "    values: 0.421\n",
      "    values: 0.577\n",
      "    values: 0.011\n",
      "    values: 0.583\n",
      "    values: 0.802\n",
      "    values: 0.008\n",
      "    values: 0.928\n",
      "    values: 0.41\n",
      "    values: 0.903\n",
      "    values: 0.062\n",
      "    values: 0.918\n",
      "    values: 0.468\n",
      "    values: 0.372\n",
      "    values: 0.504\n",
      "    values: 0.69\n",
      "    values: 0.572\n",
      "    values: 0.058\n",
      "    values: 0.761\n",
      "    values: 0.05\n",
      "    values: 0.475\n",
      "    values: 0.686\n",
      "    values: 0.696\n",
      "    values: 0.963\n",
      "    values: 0.864\n",
      "    values: 0.746\n",
      "    values: 0.1\n",
      "    values: 0.024\n",
      "    values: 0.71\n",
      "    values: 0.289\n",
      "    values: 0.826\n",
      "    values: 0.819\n",
      "    values: 0.508\n",
      "    values: 0.303\n",
      "    values: 0.231\n",
      "    values: 0.17\n",
      "    values: 0.156\n",
      "    values: 0.935\n",
      "    values: 0.01\n",
      "    values: 0.01\n",
      "    values: 0.305\n",
      "    values: 0.071\n",
      "    values: 0.248\n",
      "    values: 0.379\n",
      "    values: 0.219\n",
      "    values: 0.597\n",
      "    values: 0.977\n",
      "    values: 0.916\n",
      "    values: 0.401\n",
      "    values: 0.19\n",
      "    values: 0.679\n",
      "    values: 0.791\n",
      "    values: 0.397\n",
      "    values: 0.763\n",
      "    values: 0.961\n",
      "    values: 0.109\n",
      "    values: 0.062\n",
      "    values: 0.655\n",
      "    values: 0.924\n",
      "    values: 0.497\n",
      "    values: 0.955\n",
      "    values: 0.921\n",
      "    values: 0.201\n",
      "    values: 0.837\n",
      "    values: 0.689\n",
      "    values: 0.417\n",
      "    values: 0.667\n",
      "    values: 0.463\n",
      "    values: 0.19\n",
      "    values: 0.414\n",
      "    values: 0.525\n",
      "    values: 0.905\n",
      "    values: 0.585\n",
      "    values: 0.191\n",
      "    values: 0.997\n",
      "    values: 0.477\n",
      "    values: 0.214\n",
      "    values: 0.081\n",
      "    values: 0.106\n",
      "    values: 0.568\n",
      "    values: 0.978\n",
      "    values: 0.88\n",
      "    values: 0.202\n",
      "    values: 0.766\n",
      "    values: 0.16\n",
      "    values: 0.422\n",
      "    values: 0.07\n",
      "    values: 0.87\n",
      "    values: 0.211\n",
      "    values: 0.074\n",
      "    values: 0.944\n",
      "    values: 0.304\n",
      "    values: 0.383\n",
      "    values: 0.793\n",
      "    values: 0.984\n",
      "    values: 0.735\n",
      "    values: 0.669\n",
      "    values: 0.308\n",
      "    values: 0.73\n",
      "    values: 0.418\n",
      "    values: 0.099\n",
      "    values: 0.637\n",
      "    values: 0.493\n",
      "    values: 0.705\n",
      "    values: 0.307\n",
      "    values: 0.966\n",
      "    values: 0.532\n",
      "    values: 0.867\n",
      "    values: 0.665\n",
      "    values: 0.601\n",
      "    values: 0.443\n",
      "    values: 0.589\n",
      "    values: 0.296\n",
      "    values: 0.256\n",
      "    values: 0.524\n",
      "    values: 0.898\n",
      "    values: 0.816\n",
      "    values: 0.001\n",
      "    values: 0.673\n",
      "    values: 0.156\n",
      "    values: 0.302\n",
      "    values: 0.979\n",
      "    values: 0.722\n",
      "    values: 0.479\n",
      "    values: 0.635\n",
      "    values: 0.479\n",
      "    values: 0.879\n",
      "    values: 0.394\n",
      "    values: 0.078\n",
      "    values: 0.354\n",
      "    values: 0.741\n",
      "    values: 0.182\n",
      "    values: 0.796\n",
      "    values: 0.792\n",
      "    values: 0.59\n",
      "    values: 0.305\n",
      "    values: 0.056\n",
      "    values: 0.536\n",
      "    values: 0.041\n",
      "    values: 0.487\n",
      "    values: 0.679\n",
      "    values: 0.491\n",
      "    values: 0.586\n",
      "    values: 0.358\n",
      "    values: 0.444\n",
      "    values: 0.967\n",
      "    values: 0.739\n",
      "    values: 0.556\n",
      "    values: 0.959\n",
      "    values: 0.214\n",
      "    values: 0.919\n",
      "    values: 0.636\n",
      "    values: 0.734\n",
      "    values: 0.171\n",
      "    values: 0.96\n",
      "    values: 0.193\n",
      "    values: 0.402\n",
      "    values: 0.896\n",
      "    values: 0.694\n",
      "    values: 0.523\n",
      "    values: 0.431\n",
      "    values: 0.305\n",
      "    values: 0.624\n",
      "    values: 0.892\n",
      "    values: 0.252\n",
      "    values: 0.422\n",
      "    values: 0.11\n",
      "    values: 0.573\n",
      "    values: 0.989\n",
      "    values: 0.548\n",
      "    values: 0.097\n",
      "    values: 0.829\n",
      "    values: 0.547\n",
      "    values: 0.337\n",
      "    values: 0.334\n",
      "    values: 0.769\n",
      "    values: 0.76\n",
      "    values: 0.539\n",
      "    values: 0.269\n",
      "    values: 0.54\n",
      "    values: 0.424\n",
      "    values: 0.491\n",
      "    values: 0.488\n",
      "    values: 0.029\n",
      "    values: 0.9\n",
      "    values: 0.635\n",
      "    values: 0.934\n",
      "    values: 0.926\n",
      "    values: 0.291\n",
      "    values: 0.556\n",
      "    values: 0.361\n",
      "    values: 0.235\n",
      "    values: 0.588\n",
      "    values: 0.389\n",
      "    values: 0.753\n",
      "    values: 0.748\n",
      "    values: 0.117\n",
      "    values: 0.166\n",
      "    values: 0.382\n",
      "    values: 0.163\n",
      "    values: 0.43\n",
      "    values: 0.595\n",
      "    values: 0.067\n",
      "    values: 0.908\n",
      "    values: 0.217\n",
      "    values: 0.717\n",
      "    values: 0.721\n",
      "    values: 0.858\n",
      "    values: 0.363\n",
      "    values: 0.568\n",
      "    values: 0.32\n",
      "    values: 0.071\n",
      "    values: 0.099\n",
      "    values: 0.91\n",
      "    values: 0.774\n",
      "    values: 0.67\n",
      "    values: 0.308\n",
      "    values: 0.616\n",
      "    values: 0.109\n",
      "    values: 0.339\n",
      "    values: 0.311\n",
      "    values: 0.023\n",
      "    values: 0.368\n",
      "    values: 0.462\n",
      "    values: 0.158\n",
      "    values: 0.965\n",
      "    values: 0.338\n",
      "    values: 0.374\n",
      "    values: 0.048\n",
      "    values: 0.195\n",
      "    values: 0.972\n",
      "    values: 0.57\n",
      "    values: 0.623\n",
      "    values: 0.898\n",
      "    values: 0.244\n",
      "    values: 0.457\n",
      "    values: 0.845\n",
      "    values: 0.381\n",
      "    values: 0.89\n",
      "    values: 0.814\n",
      "    values: 0.713\n",
      "    values: 0.309\n",
      "    values: 0.73\n",
      "    values: 0.739\n",
      "    values: 0.596\n",
      "    values: 0.556\n",
      "    values: 0.712\n",
      "    values: 0.843\n",
      "    values: 0.568\n",
      "    values: 0.386\n",
      "    values: 0.095\n",
      "    values: 0.041\n",
      "    values: 0.551\n",
      "    values: 0.556\n",
      "    values: 0.446\n",
      "    values: 0.049\n",
      "    values: 0.21\n",
      "    values: 0.537\n",
      "    values: 0.685\n",
      "    values: 0.225\n",
      "    values: 0.84\n",
      "    values: 0.034\n",
      "    values: 0.703\n",
      "    values: 0.725\n",
      "    values: 0.542\n",
      "    values: 0.338\n",
      "    values: 0.628\n",
      "    values: 0.022\n",
      "    values: 0.338\n",
      "    values: 0.568\n",
      "    values: 0.528\n",
      "    values: 0.475\n",
      "    values: 0.911\n",
      "    values: 0.312\n",
      "    values: 0.898\n",
      "    values: 0.362\n",
      "    values: 0.68\n",
      "    values: 0.111\n",
      "    values: 0.77\n",
      "    values: 0.505\n",
      "    values: 0.847\n",
      "    values: 0.468\n",
      "    values: 0.086\n",
      "    values: 0.127\n",
      "    values: 0.775\n",
      "    values: 0.758\n",
      "    values: 0.423\n",
      "    values: 0.442\n",
      "    values: 0.721\n",
      "    values: 0.181\n",
      "    values: 0.733\n",
      "    values: 0.308\n",
      "    values: 0.705\n",
      "    values: 0.147\n",
      "    values: 0.42\n",
      "    values: 0.148\n",
      "    values: 0.576\n",
      "    values: 0.048\n",
      "    values: 0.018\n",
      "    values: 0.225\n",
      "    values: 0.231\n",
      "    values: 0.942\n",
      "    values: 0.196\n",
      "    values: 0.968\n",
      "    values: 0.515\n",
      "    values: 0.856\n",
      "    values: 0.461\n",
      "    values: 0.935\n",
      "    values: 0.92\n",
      "    values: 0.574\n",
      "    values: 0.693\n",
      "    values: 0.87\n",
      "    values: 0.36\n",
      "    values: 0.533\n",
      "    values: 0.749\n",
      "    values: 0.908\n",
      "    values: 0.019\n",
      "    values: 0.796\n",
      "    values: 0.462\n",
      "    values: 0.603\n",
      "    values: 0.81\n",
      "    values: 0.076\n",
      "    values: 0.612\n",
      "    values: 0.542\n",
      "    values: 0.08\n",
      "    values: 0.859\n",
      "    values: 0.218\n",
      "    values: 0.127\n",
      "    values: 0.998\n",
      "    values: 0.824\n",
      "    values: 0.712\n",
      "    values: 0.216\n",
      "    values: 0.788\n",
      "    values: 0.327\n",
      "    values: 0.786\n",
      "    values: 0.651\n",
      "    values: 0.329\n",
      "    values: 0.413\n",
      "    values: 0.071\n",
      "    values: 0.444\n",
      "    values: 0.005\n",
      "    values: 0.89\n",
      "    values: 0.152\n",
      "    values: 0.186\n",
      "    values: 0.359\n",
      "    values: 0.527\n",
      "    values: 0.202\n",
      "    values: 0.308\n",
      "    values: 0.161\n",
      "    values: 0.642\n",
      "    values: 0.272\n",
      "    values: 0.662\n",
      "    values: 0.075\n",
      "    values: 0.948\n",
      "    values: 0.104\n",
      "    values: 0.949\n",
      "    values: 0.613\n",
      "    values: 0.231\n",
      "    values: 0.342\n",
      "    values: 0.011\n",
      "    values: 0.664\n",
      "    values: 0.792\n",
      "    values: 0.939\n",
      "    values: 0.659\n",
      "    values: 0.023\n",
      "    values: 0.498\n",
      "    values: 0.154\n",
      "    values: 0.318\n",
      "    values: 0.973\n",
      "    values: 0.822\n",
      "    values: 0.828\n",
      "    values: 0.118\n",
      "    values: 0.602\n",
      "    values: 0.712\n",
      "    values: 0.076\n",
      "    values: 0.178\n",
      "    values: 0.311\n",
      "    values: 0.747\n",
      "    values: 0.116\n",
      "    values: 0.11\n",
      "    values: 0.633\n",
      "    values: 0.38\n",
      "    values: 0.153\n",
      "    values: 0.202\n",
      "    values: 0.522\n",
      "    values: 0.632\n",
      "    values: 0.602\n",
      "    values: 0.205\n",
      "    values: 0.288\n",
      "    values: 0.878\n",
      "    values: 0.948\n",
      "    values: 0.745\n",
      "    values: 0.019\n",
      "    values: 0.542\n",
      "    values: 0.531\n",
      "    values: 0.611\n",
      "    values: 0.188\n",
      "    values: 0.416\n",
      "    values: 0.861\n",
      "    values: 0.329\n",
      "    values: 0.438\n",
      "    values: 0.434\n",
      "    values: 0.983\n",
      "    values: 0.065\n",
      "    values: 0.496\n",
      "    values: 0.657\n",
      "    values: 0.142\n",
      "    values: 0.181\n",
      "    values: 0.685\n",
      "    values: 0.635\n",
      "    values: 0.767\n",
      "    values: 0.336\n",
      "    values: 0.914\n",
      "    values: 0.135\n",
      "    values: 0.99\n",
      "    values: 0.34\n",
      "    values: 0.101\n",
      "    values: 0.138\n",
      "    values: 0.905\n",
      "    values: 0.056\n",
      "    values: 0.487\n",
      "    values: 0.627\n",
      "    values: 0.109\n",
      "    values: 0.06\n",
      "    values: 0.089\n",
      "    values: 0.761\n",
      "    values: 0.043\n",
      "    values: 0.229\n",
      "    values: 0.253\n",
      "    values: 0.379\n",
      "    values: 0.541\n",
      "    values: 0.756\n",
      "    values: 0.654\n",
      "    values: 0.654\n",
      "    values: 0.83\n",
      "    values: 0.598\n",
      "    values: 0.349\n",
      "    values: 0.689\n",
      "    values: 0.606\n",
      "    values: 0.335\n",
      "    values: 0.139\n",
      "    values: 0.67\n",
      "    values: 0.641\n",
      "    values: 0.907\n",
      "    values: 0.563\n",
      "    values: 0.188\n",
      "    values: 0.43\n",
      "    values: 0.412\n",
      "    values: 0.635\n",
      "    values: 0.051\n",
      "    values: 0.445\n",
      "    values: 0.086\n",
      "    values: 0.157\n",
      "    values: 0.482\n",
      "    values: 0.699\n",
      "    values: 0.805\n",
      "    values: 0.849\n",
      "    values: 0.812\n",
      "    values: 0.381\n",
      "    values: 0.459\n",
      "    values: 0.974\n",
      "    values: 0.257\n",
      "    values: 0.879\n",
      "    values: 0.42\n",
      "    values: 0.008\n",
      "    values: 0.931\n",
      "    values: 0.028\n",
      "    values: 0.968\n",
      "    values: 0.891\n",
      "    values: 0.408\n",
      "    values: 0.253\n",
      "    values: 0.174\n",
      "    values: 0.608\n",
      "    values: 0.847\n",
      "    values: 0.908\n",
      "    values: 0.488\n",
      "    values: 0.287\n",
      "    values: 0.656\n",
      "    values: 0.013\n",
      "    values: 0.377\n",
      "    values: 0.638\n",
      "    values: 0.851\n",
      "    values: 0.631\n",
      "    values: 0.726\n",
      "    values: 0.528\n",
      "    values: 0.405\n",
      "    values: 0.315\n",
      "    values: 0.629\n",
      "    values: 0.812\n",
      "    values: 0.734\n",
      "    values: 0.01\n",
      "    values: 0.417\n",
      "    values: 0.731\n",
      "    values: 0.615\n",
      "    values: 0.384\n",
      "    values: 0.902\n",
      "    values: 0.16\n",
      "    values: 0.703\n",
      "    values: 0.24\n",
      "    values: 0.493\n",
      "    values: 0.899\n",
      "    values: 0.047\n",
      "    values: 0.41\n",
      "    values: 0.576\n",
      "    values: 0.581\n",
      "    values: 0.425\n",
      "    values: 0.483\n",
      "    values: 0.592\n",
      "    values: 0.817\n",
      "    values: 0.675\n",
      "    values: 0.49\n",
      "    values: 0.033\n",
      "    values: 0.672\n",
      "    values: 0.638\n",
      "    values: 0.173\n",
      "    values: 0.504\n",
      "    values: 0.829\n",
      "    values: 0.445\n",
      "    values: 0.369\n",
      "    values: 0.54\n",
      "    values: 0.146\n",
      "    values: 0.332\n",
      "    values: 0.716\n",
      "    values: 0.485\n",
      "    values: 0.741\n",
      "    values: 0.427\n",
      "    values: 0.607\n",
      "    values: 0.437\n",
      "    values: 0.082\n",
      "    values: 0.302\n",
      "    values: 0.177\n",
      "    values: 0.22\n",
      "    values: 0.795\n",
      "    values: 0.129\n",
      "    values: 0.834\n",
      "    values: 0.905\n",
      "    values: 0.04\n",
      "    values: 0.193\n",
      "  }\n",
      "}\n",
      "\n",
      "Response:\n",
      "data {\n",
      "  names: \"t:0\"\n",
      "  names: \"t:1\"\n",
      "  names: \"t:2\"\n",
      "  names: \"t:3\"\n",
      "  names: \"t:4\"\n",
      "  names: \"t:5\"\n",
      "  names: \"t:6\"\n",
      "  names: \"t:7\"\n",
      "  names: \"t:8\"\n",
      "  names: \"t:9\"\n",
      "  tensor {\n",
      "    shape: 1\n",
      "    shape: 10\n",
      "    values: 0.016527308151125908\n",
      "    values: 0.03343753144145012\n",
      "    values: 0.13515257835388184\n",
      "    values: 0.2837943434715271\n",
      "    values: 0.046536825597286224\n",
      "    values: 0.04741676151752472\n",
      "    values: 0.015463653951883316\n",
      "    values: 0.01107808854430914\n",
      "    values: 0.37488991022109985\n",
      "    values: 0.03570308908820152\n",
      "  }\n",
      "}\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "!seldon-core-tester contract.json 0.0.0.0 5000 -p -t --grpc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "nodejs_mnist_predictor\r\n"
     ]
    }
   ],
   "source": [
    "!docker rm nodejs_mnist_predictor --force"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Test using Minikube\n",
    "\n",
    "**Due to a [minikube/s2i issue](https://github.com/SeldonIO/seldon-core/issues/253) you will need [s2i >= 1.1.13](https://github.com/openshift/source-to-image/releases/tag/v1.1.13)**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "😄  minikube v0.34.1 on linux (amd64)\n",
      "🔥  Creating virtualbox VM (CPUs=2, Memory=4096MB, Disk=20000MB) ...\n",
      "📶  \"minikube\" IP address is 192.168.99.100\n",
      "🐳  Configuring Docker as the container runtime ...\n",
      "✨  Preparing Kubernetes environment ...\n",
      "🚜  Pulling images required by Kubernetes v1.13.3 ...\n",
      "🚀  Launching Kubernetes v1.13.3 using kubeadm ... \n",
      "🔑  Configuring cluster permissions ...\n",
      "🤔  Verifying component health .....\n",
      "💗  kubectl is now configured to use \"minikube\"\n",
      "🏄  Done! Thank you for using minikube!\n"
     ]
    }
   ],
   "source": [
    "!minikube start --memory 4096"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "clusterrolebinding.rbac.authorization.k8s.io/kube-system-cluster-admin created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl create clusterrolebinding kube-system-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "$HELM_HOME has been configured at /home/clive/.helm.\n",
      "\n",
      "Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.\n",
      "\n",
      "Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.\n",
      "To prevent this, run `helm init` with the --tiller-tls-verify flag.\n",
      "For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation\n",
      "Happy Helming!\n"
     ]
    }
   ],
   "source": [
    "!helm init"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Waiting for deployment \"tiller-deploy\" rollout to finish: 0 of 1 updated replicas are available...\n",
      "deployment \"tiller-deploy\" successfully rolled out\n"
     ]
    }
   ],
   "source": [
    "!kubectl rollout status deploy/tiller-deploy -n kube-system"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "NAME:   seldon-core\n",
      "LAST DEPLOYED: Tue Apr 16 15:29:41 2019\n",
      "NAMESPACE: seldon-system\n",
      "STATUS: DEPLOYED\n",
      "\n",
      "RESOURCES:\n",
      "==> v1/ClusterRoleBinding\n",
      "NAME                                 AGE\n",
      "seldon-operator-manager-rolebinding  1s\n",
      "\n",
      "==> v1/Service\n",
      "NAME                                        TYPE       CLUSTER-IP      EXTERNAL-IP  PORT(S)  AGE\n",
      "seldon-operator-controller-manager-service  ClusterIP  10.107.173.100  <none>       443/TCP  1s\n",
      "\n",
      "==> v1beta1/Deployment\n",
      "NAME                        DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE\n",
      "seldon-spartakus-volunteer  1        0        0           0          1s\n",
      "\n",
      "==> v1beta1/ClusterRole\n",
      "NAME                        AGE\n",
      "seldon-spartakus-volunteer  1s\n",
      "\n",
      "==> v1beta1/ClusterRoleBinding\n",
      "NAME                        AGE\n",
      "seldon-spartakus-volunteer  1s\n",
      "\n",
      "==> v1/Secret\n",
      "NAME                                   TYPE    DATA  AGE\n",
      "seldon-operator-webhook-server-secret  Opaque  0     1s\n",
      "\n",
      "==> v1/ConfigMap\n",
      "NAME                     DATA  AGE\n",
      "seldon-spartakus-config  3     1s\n",
      "\n",
      "==> v1beta1/CustomResourceDefinition\n",
      "NAME                                         AGE\n",
      "seldondeployments.machinelearning.seldon.io  1s\n",
      "\n",
      "==> v1/Pod(related)\n",
      "NAME                                  READY  STATUS             RESTARTS  AGE\n",
      "seldon-operator-controller-manager-0  0/1    ContainerCreating  0         1s\n",
      "\n",
      "==> v1/ClusterRole\n",
      "NAME                          AGE\n",
      "seldon-operator-manager-role  1s\n",
      "\n",
      "==> v1/StatefulSet\n",
      "NAME                                DESIRED  CURRENT  AGE\n",
      "seldon-operator-controller-manager  1        1        1s\n",
      "\n",
      "==> v1/ServiceAccount\n",
      "NAME                        SECRETS  AGE\n",
      "seldon-spartakus-volunteer  1        1s\n",
      "\n",
      "\n",
      "NOTES:\n",
      "NOTES: TODO\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "!helm install ../../../helm-charts/seldon-core-operator --name seldon-core --set usageMetrics.enabled=true   --namespace seldon-system"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "partitioned roll out complete: 1 new pods have been updated...\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl rollout status deploy/seldon-controller-manager -n seldon-system"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Setup Ingress\n",
    "Please note: There are reported gRPC issues with ambassador (see https://github.com/SeldonIO/seldon-core/issues/473)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "NAME:   ambassador\n",
      "LAST DEPLOYED: Tue Apr 16 15:30:27 2019\n",
      "NAMESPACE: seldon\n",
      "STATUS: DEPLOYED\n",
      "\n",
      "RESOURCES:\n",
      "==> v1/Pod(related)\n",
      "NAME                         READY  STATUS             RESTARTS  AGE\n",
      "ambassador-5b89d44544-b2snz  0/1    ContainerCreating  0         0s\n",
      "ambassador-5b89d44544-ktd9h  0/1    ContainerCreating  0         0s\n",
      "ambassador-5b89d44544-x8tcg  0/1    ContainerCreating  0         0s\n",
      "\n",
      "==> v1/ServiceAccount\n",
      "NAME        SECRETS  AGE\n",
      "ambassador  1        0s\n",
      "\n",
      "==> v1beta1/ClusterRole\n",
      "NAME        AGE\n",
      "ambassador  0s\n",
      "\n",
      "==> v1beta1/ClusterRoleBinding\n",
      "NAME        AGE\n",
      "ambassador  0s\n",
      "\n",
      "==> v1/Service\n",
      "NAME               TYPE          CLUSTER-IP     EXTERNAL-IP  PORT(S)                     AGE\n",
      "ambassador-admins  ClusterIP     10.98.139.122  <none>       8877/TCP                    0s\n",
      "ambassador         LoadBalancer  10.98.135.113  <pending>    80:31109/TCP,443:30421/TCP  0s\n",
      "\n",
      "==> v1/Deployment\n",
      "NAME        DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE\n",
      "ambassador  3        3        3           0          0s\n",
      "\n",
      "\n",
      "NOTES:\n",
      "Congratuations! You've successfully installed Ambassador.\n",
      "\n",
      "For help, visit our Slack at https://d6e.co/slack or view the documentation online at https://www.getambassador.io.\n",
      "\n",
      "To get the IP address of Ambassador, run the following commands:\n",
      "NOTE: It may take a few minutes for the LoadBalancer IP to be available.\n",
      "     You can watch the status of by running 'kubectl get svc -w  --namespace seldon ambassador'\n",
      "\n",
      "  On GKE/Azure:\n",
      "  export SERVICE_IP=$(kubectl get svc --namespace seldon ambassador -o jsonpath='{.status.loadBalancer.ingress[0].ip}')\n",
      "\n",
      "  On AWS:\n",
      "  export SERVICE_IP=$(kubectl get svc --namespace seldon ambassador -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')\n",
      "\n",
      "  echo http://$SERVICE_IP:\n",
      "\n"
     ]
    }
   ],
   "source": [
    "!helm install stable/ambassador --name ambassador --set crds.keep=false"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Waiting for deployment \"ambassador\" rollout to finish: 0 of 3 updated replicas are available...\n",
      "Waiting for deployment \"ambassador\" rollout to finish: 1 of 3 updated replicas are available...\n",
      "Waiting for deployment \"ambassador\" rollout to finish: 2 of 3 updated replicas are available...\n",
      "deployment \"ambassador\" successfully rolled out\n"
     ]
    }
   ],
   "source": [
    "!kubectl rollout status deployment.apps/ambassador"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "---> Installing application source...\n",
      "---> Installing dependencies ...\n",
      "\n",
      "> @tensorflow/tfjs-node@0.1.15 install /microservice/model/node_modules/@tensorflow/tfjs-node\n",
      "> node scripts/install.js\n",
      "\n",
      "* Downloading libtensorflow\n",
      "\n",
      "* Building TensorFlow Node.js bindings\n",
      "\n",
      "> protobufjs@6.8.8 postinstall /microservice/model/node_modules/protobufjs\n",
      "> node scripts/postinstall\n",
      "\n",
      "npm notice created a lockfile as package-lock.json. You should commit this file.\n",
      "npm WARN nodejs_mnist@1.0.0 No repository field.\n",
      "npm WARN nodejs_mnist@1.0.0 No license field.\n",
      "\n",
      "added 50 packages from 58 contributors and audited 64 packages in 15.755s\n",
      "found 0 vulnerabilities\n",
      "\n",
      "Build completed successfully\n"
     ]
    }
   ],
   "source": [
    "!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-nodejs:0.2-SNAPSHOT node-s2i-mnist-model:0.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "seldondeployment.machinelearning.seldon.io/seldon-deployment-example created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl create -f nodejs_mnist_deployment.json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Waiting for deployment \"nodejs-mnist-deployment-nodejs-mnist-predictor-5aa9edd\" rollout to finish: 0 of 1 updated replicas are available...\n",
      "deployment \"nodejs-mnist-deployment-nodejs-mnist-predictor-5aa9edd\" successfully rolled out\n"
     ]
    }
   ],
   "source": [
    "!kubectl rollout status deploy/nodejs-mnist-deployment-nodejs-mnist-predictor-5aa9edd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "----------------------------------------\r\n",
      "SENDING NEW REQUEST:\r\n",
      "\r\n",
      "[[[[0.743]\r\n",
      "   [0.335]\r\n",
      "   [0.726]\r\n",
      "   [0.051]\r\n",
      "   [0.954]\r\n",
      "   [0.716]\r\n",
      "   [0.094]\r\n",
      "   [0.447]\r\n",
      "   [0.524]\r\n",
      "   [0.431]\r\n",
      "   [0.749]\r\n",
      "   [0.034]\r\n",
      "   [0.607]\r\n",
      "   [0.342]\r\n",
      "   [0.035]\r\n",
      "   [0.744]\r\n",
      "   [0.838]\r\n",
      "   [0.29 ]\r\n",
      "   [0.311]\r\n",
      "   [0.091]\r\n",
      "   [0.177]\r\n",
      "   [0.049]\r\n",
      "   [0.43 ]\r\n",
      "   [0.469]\r\n",
      "   [0.766]\r\n",
      "   [0.137]\r\n",
      "   [0.517]\r\n",
      "   [0.814]]\r\n",
      "\r\n",
      "  [[0.066]\r\n",
      "   [0.168]\r\n",
      "   [0.69 ]\r\n",
      "   [0.733]\r\n",
      "   [0.658]\r\n",
      "   [0.838]\r\n",
      "   [0.867]\r\n",
      "   [0.485]\r\n",
      "   [0.093]\r\n",
      "   [0.405]\r\n",
      "   [0.809]\r\n",
      "   [0.592]\r\n",
      "   [0.574]\r\n",
      "   [0.449]\r\n",
      "   [0.776]\r\n",
      "   [0.988]\r\n",
      "   [0.428]\r\n",
      "   [0.912]\r\n",
      "   [0.351]\r\n",
      "   [0.406]\r\n",
      "   [0.919]\r\n",
      "   [0.832]\r\n",
      "   [0.639]\r\n",
      "   [0.342]\r\n",
      "   [0.778]\r\n",
      "   [0.31 ]\r\n",
      "   [0.476]\r\n",
      "   [0.828]]\r\n",
      "\r\n",
      "  [[0.99 ]\r\n",
      "   [0.076]\r\n",
      "   [0.238]\r\n",
      "   [0.941]\r\n",
      "   [0.442]\r\n",
      "   [0.998]\r\n",
      "   [0.591]\r\n",
      "   [0.486]\r\n",
      "   [0.631]\r\n",
      "   [0.312]\r\n",
      "   [0.679]\r\n",
      "   [0.214]\r\n",
      "   [0.79 ]\r\n",
      "   [0.207]\r\n",
      "   [0.965]\r\n",
      "   [0.912]\r\n",
      "   [0.247]\r\n",
      "   [0.851]\r\n",
      "   [0.761]\r\n",
      "   [0.833]\r\n",
      "   [0.875]\r\n",
      "   [0.284]\r\n",
      "   [0.352]\r\n",
      "   [0.884]\r\n",
      "   [0.517]\r\n",
      "   [0.547]\r\n",
      "   [0.487]\r\n",
      "   [0.13 ]]\r\n",
      "\r\n",
      "  [[0.395]\r\n",
      "   [0.259]\r\n",
      "   [0.773]\r\n",
      "   [0.935]\r\n",
      "   [0.686]\r\n",
      "   [0.526]\r\n",
      "   [0.319]\r\n",
      "   [0.254]\r\n",
      "   [0.771]\r\n",
      "   [0.428]\r\n",
      "   [0.621]\r\n",
      "   [0.546]\r\n",
      "   [0.167]\r\n",
      "   [0.678]\r\n",
      "   [0.364]\r\n",
      "   [0.173]\r\n",
      "   [0.834]\r\n",
      "   [0.298]\r\n",
      "   [0.069]\r\n",
      "   [0.427]\r\n",
      "   [0.98 ]\r\n",
      "   [0.53 ]\r\n",
      "   [0.422]\r\n",
      "   [0.303]\r\n",
      "   [0.828]\r\n",
      "   [0.857]\r\n",
      "   [0.258]\r\n",
      "   [0.837]]\r\n",
      "\r\n",
      "  [[0.204]\r\n",
      "   [0.755]\r\n",
      "   [0.256]\r\n",
      "   [0.964]\r\n",
      "   [0.774]\r\n",
      "   [0.533]\r\n",
      "   [0.692]\r\n",
      "   [0.152]\r\n",
      "   [0.491]\r\n",
      "   [0.913]\r\n",
      "   [0.161]\r\n",
      "   [0.909]\r\n",
      "   [0.278]\r\n",
      "   [0.436]\r\n",
      "   [0.642]\r\n",
      "   [0.598]\r\n",
      "   [0.094]\r\n",
      "   [0.39 ]\r\n",
      "   [0.706]\r\n",
      "   [0.882]\r\n",
      "   [0.906]\r\n",
      "   [0.402]\r\n",
      "   [0.653]\r\n",
      "   [0.792]\r\n",
      "   [0.458]\r\n",
      "   [0.106]\r\n",
      "   [0.601]\r\n",
      "   [0.867]]\r\n",
      "\r\n",
      "  [[0.548]\r\n",
      "   [0.711]\r\n",
      "   [0.079]\r\n",
      "   [0.998]\r\n",
      "   [0.812]\r\n",
      "   [0.547]\r\n",
      "   [0.582]\r\n",
      "   [0.086]\r\n",
      "   [0.336]\r\n",
      "   [0.223]\r\n",
      "   [0.037]\r\n",
      "   [0.945]\r\n",
      "   [0.816]\r\n",
      "   [0.354]\r\n",
      "   [0.991]\r\n",
      "   [0.817]\r\n",
      "   [0.41 ]\r\n",
      "   [0.591]\r\n",
      "   [0.138]\r\n",
      "   [0.485]\r\n",
      "   [0.348]\r\n",
      "   [0.503]\r\n",
      "   [0.626]\r\n",
      "   [0.037]\r\n",
      "   [0.862]\r\n",
      "   [0.258]\r\n",
      "   [0.128]\r\n",
      "   [0.828]]\r\n",
      "\r\n",
      "  [[0.483]\r\n",
      "   [0.789]\r\n",
      "   [0.076]\r\n",
      "   [0.618]\r\n",
      "   [0.162]\r\n",
      "   [0.201]\r\n",
      "   [0.927]\r\n",
      "   [0.436]\r\n",
      "   [0.609]\r\n",
      "   [0.123]\r\n",
      "   [0.599]\r\n",
      "   [0.038]\r\n",
      "   [0.836]\r\n",
      "   [0.506]\r\n",
      "   [0.727]\r\n",
      "   [0.783]\r\n",
      "   [0.522]\r\n",
      "   [0.925]\r\n",
      "   [0.628]\r\n",
      "   [0.938]\r\n",
      "   [0.388]\r\n",
      "   [0.07 ]\r\n",
      "   [0.262]\r\n",
      "   [0.163]\r\n",
      "   [0.295]\r\n",
      "   [0.632]\r\n",
      "   [0.331]\r\n",
      "   [0.129]]\r\n",
      "\r\n",
      "  [[0.704]\r\n",
      "   [0.126]\r\n",
      "   [0.011]\r\n",
      "   [0.974]\r\n",
      "   [0.22 ]\r\n",
      "   [0.693]\r\n",
      "   [0.798]\r\n",
      "   [0.579]\r\n",
      "   [0.074]\r\n",
      "   [0.76 ]\r\n",
      "   [0.482]\r\n",
      "   [0.651]\r\n",
      "   [0.85 ]\r\n",
      "   [0.972]\r\n",
      "   [0.911]\r\n",
      "   [0.297]\r\n",
      "   [0.036]\r\n",
      "   [0.71 ]\r\n",
      "   [0.854]\r\n",
      "   [0.489]\r\n",
      "   [0.211]\r\n",
      "   [0.778]\r\n",
      "   [0.374]\r\n",
      "   [0.454]\r\n",
      "   [0.717]\r\n",
      "   [0.142]\r\n",
      "   [0.378]\r\n",
      "   [0.087]]\r\n",
      "\r\n",
      "  [[0.487]\r\n",
      "   [0.761]\r\n",
      "   [0.703]\r\n",
      "   [0.202]\r\n",
      "   [0.948]\r\n",
      "   [0.699]\r\n",
      "   [0.946]\r\n",
      "   [0.444]\r\n",
      "   [0.229]\r\n",
      "   [0.612]\r\n",
      "   [0.659]\r\n",
      "   [0.45 ]\r\n",
      "   [0.554]\r\n",
      "   [0.13 ]\r\n",
      "   [0.97 ]\r\n",
      "   [0.215]\r\n",
      "   [0.519]\r\n",
      "   [0.627]\r\n",
      "   [0.519]\r\n",
      "   [0.948]\r\n",
      "   [0.212]\r\n",
      "   [0.087]\r\n",
      "   [0.704]\r\n",
      "   [0.853]\r\n",
      "   [0.931]\r\n",
      "   [0.484]\r\n",
      "   [0.218]\r\n",
      "   [0.998]]\r\n",
      "\r\n",
      "  [[0.376]\r\n",
      "   [0.14 ]\r\n",
      "   [0.053]\r\n",
      "   [0.322]\r\n",
      "   [0.542]\r\n",
      "   [0.357]\r\n",
      "   [0.858]\r\n",
      "   [0.903]\r\n",
      "   [0.292]\r\n",
      "   [0.812]\r\n",
      "   [0.436]\r\n",
      "   [0.049]\r\n",
      "   [0.629]\r\n",
      "   [0.679]\r\n",
      "   [0.968]\r\n",
      "   [0.974]\r\n",
      "   [0.842]\r\n",
      "   [0.936]\r\n",
      "   [0.855]\r\n",
      "   [0.371]\r\n",
      "   [0.808]\r\n",
      "   [0.243]\r\n",
      "   [0.355]\r\n",
      "   [0.221]\r\n",
      "   [0.141]\r\n",
      "   [0.972]\r\n",
      "   [0.104]\r\n",
      "   [0.729]]\r\n",
      "\r\n",
      "  [[0.843]\r\n",
      "   [0.73 ]\r\n",
      "   [0.963]\r\n",
      "   [0.455]\r\n",
      "   [0.357]\r\n",
      "   [0.34 ]\r\n",
      "   [0.251]\r\n",
      "   [0.939]\r\n",
      "   [0.118]\r\n",
      "   [0.237]\r\n",
      "   [0.926]\r\n",
      "   [0.853]\r\n",
      "   [0.832]\r\n",
      "   [0.59 ]\r\n",
      "   [0.132]\r\n",
      "   [0.55 ]\r\n",
      "   [0.792]\r\n",
      "   [0.974]\r\n",
      "   [0.025]\r\n",
      "   [0.417]\r\n",
      "   [0.517]\r\n",
      "   [0.083]\r\n",
      "   [0.152]\r\n",
      "   [0.01 ]\r\n",
      "   [0.782]\r\n",
      "   [0.036]\r\n",
      "   [0.022]\r\n",
      "   [0.244]]\r\n",
      "\r\n",
      "  [[0.207]\r\n",
      "   [0.481]\r\n",
      "   [0.655]\r\n",
      "   [0.173]\r\n",
      "   [0.721]\r\n",
      "   [0.283]\r\n",
      "   [0.163]\r\n",
      "   [0.418]\r\n",
      "   [0.402]\r\n",
      "   [0.006]\r\n",
      "   [0.974]\r\n",
      "   [0.953]\r\n",
      "   [0.989]\r\n",
      "   [0.952]\r\n",
      "   [0.895]\r\n",
      "   [0.112]\r\n",
      "   [0.886]\r\n",
      "   [0.226]\r\n",
      "   [0.394]\r\n",
      "   [0.566]\r\n",
      "   [0.728]\r\n",
      "   [0.959]\r\n",
      "   [0.452]\r\n",
      "   [0.296]\r\n",
      "   [0.662]\r\n",
      "   [0.372]\r\n",
      "   [0.872]\r\n",
      "   [0.443]]\r\n",
      "\r\n",
      "  [[0.579]\r\n",
      "   [0.698]\r\n",
      "   [0.936]\r\n",
      "   [0.521]\r\n",
      "   [0.126]\r\n",
      "   [0.216]\r\n",
      "   [0.36 ]\r\n",
      "   [0.208]\r\n",
      "   [0.709]\r\n",
      "   [0.747]\r\n",
      "   [0.178]\r\n",
      "   [0.201]\r\n",
      "   [0.875]\r\n",
      "   [0.518]\r\n",
      "   [0.173]\r\n",
      "   [0.453]\r\n",
      "   [0.293]\r\n",
      "   [0.571]\r\n",
      "   [0.448]\r\n",
      "   [0.16 ]\r\n",
      "   [0.096]\r\n",
      "   [0.572]\r\n",
      "   [0.837]\r\n",
      "   [0.276]\r\n",
      "   [0.597]\r\n",
      "   [0.151]\r\n",
      "   [0.56 ]\r\n",
      "   [0.653]]\r\n",
      "\r\n",
      "  [[0.905]\r\n",
      "   [0.3  ]\r\n",
      "   [0.38 ]\r\n",
      "   [0.8  ]\r\n",
      "   [0.475]\r\n",
      "   [0.52 ]\r\n",
      "   [0.982]\r\n",
      "   [0.077]\r\n",
      "   [0.691]\r\n",
      "   [0.204]\r\n",
      "   [0.931]\r\n",
      "   [0.573]\r\n",
      "   [0.875]\r\n",
      "   [0.084]\r\n",
      "   [0.112]\r\n",
      "   [0.312]\r\n",
      "   [0.422]\r\n",
      "   [0.393]\r\n",
      "   [0.98 ]\r\n",
      "   [0.145]\r\n",
      "   [0.734]\r\n",
      "   [0.21 ]\r\n",
      "   [0.741]\r\n",
      "   [0.666]\r\n",
      "   [0.925]\r\n",
      "   [0.987]\r\n",
      "   [0.583]\r\n",
      "   [0.84 ]]\r\n",
      "\r\n",
      "  [[0.036]\r\n",
      "   [0.916]\r\n",
      "   [0.312]\r\n",
      "   [0.495]\r\n",
      "   [0.701]\r\n",
      "   [0.547]\r\n",
      "   [0.483]\r\n",
      "   [0.231]\r\n",
      "   [0.218]\r\n",
      "   [0.912]\r\n",
      "   [0.561]\r\n",
      "   [0.881]\r\n",
      "   [0.039]\r\n",
      "   [0.969]\r\n",
      "   [0.147]\r\n",
      "   [0.615]\r\n",
      "   [0.582]\r\n",
      "   [0.554]\r\n",
      "   [0.715]\r\n",
      "   [0.607]\r\n",
      "   [0.972]\r\n",
      "   [0.898]\r\n",
      "   [0.923]\r\n",
      "   [0.08 ]\r\n",
      "   [0.511]\r\n",
      "   [0.111]\r\n",
      "   [0.446]\r\n",
      "   [0.984]]\r\n",
      "\r\n",
      "  [[0.646]\r\n",
      "   [0.753]\r\n",
      "   [0.474]\r\n",
      "   [0.689]\r\n",
      "   [0.697]\r\n",
      "   [0.093]\r\n",
      "   [0.372]\r\n",
      "   [0.584]\r\n",
      "   [0.55 ]\r\n",
      "   [0.768]\r\n",
      "   [0.964]\r\n",
      "   [0.414]\r\n",
      "   [0.129]\r\n",
      "   [0.021]\r\n",
      "   [0.635]\r\n",
      "   [0.766]\r\n",
      "   [0.588]\r\n",
      "   [0.454]\r\n",
      "   [0.927]\r\n",
      "   [0.898]\r\n",
      "   [0.613]\r\n",
      "   [0.992]\r\n",
      "   [0.736]\r\n",
      "   [0.888]\r\n",
      "   [0.329]\r\n",
      "   [0.931]\r\n",
      "   [0.043]\r\n",
      "   [0.12 ]]\r\n",
      "\r\n",
      "  [[0.514]\r\n",
      "   [0.151]\r\n",
      "   [0.128]\r\n",
      "   [0.178]\r\n",
      "   [0.809]\r\n",
      "   [0.338]\r\n",
      "   [0.104]\r\n",
      "   [0.454]\r\n",
      "   [0.523]\r\n",
      "   [0.391]\r\n",
      "   [0.005]\r\n",
      "   [0.045]\r\n",
      "   [0.837]\r\n",
      "   [0.023]\r\n",
      "   [0.483]\r\n",
      "   [0.148]\r\n",
      "   [0.13 ]\r\n",
      "   [0.457]\r\n",
      "   [0.517]\r\n",
      "   [0.344]\r\n",
      "   [0.94 ]\r\n",
      "   [0.461]\r\n",
      "   [0.98 ]\r\n",
      "   [0.368]\r\n",
      "   [0.453]\r\n",
      "   [0.71 ]\r\n",
      "   [0.65 ]\r\n",
      "   [0.838]]\r\n",
      "\r\n",
      "  [[0.691]\r\n",
      "   [0.838]\r\n",
      "   [0.411]\r\n",
      "   [0.18 ]\r\n",
      "   [0.769]\r\n",
      "   [0.928]\r\n",
      "   [0.898]\r\n",
      "   [0.237]\r\n",
      "   [0.134]\r\n",
      "   [0.892]\r\n",
      "   [0.428]\r\n",
      "   [0.977]\r\n",
      "   [0.295]\r\n",
      "   [0.917]\r\n",
      "   [0.374]\r\n",
      "   [0.494]\r\n",
      "   [0.913]\r\n",
      "   [0.889]\r\n",
      "   [0.635]\r\n",
      "   [0.633]\r\n",
      "   [0.452]\r\n",
      "   [0.76 ]\r\n",
      "   [0.809]\r\n",
      "   [0.593]\r\n",
      "   [0.001]\r\n",
      "   [0.708]\r\n",
      "   [0.546]\r\n",
      "   [0.826]]\r\n",
      "\r\n",
      "  [[0.011]\r\n",
      "   [0.106]\r\n",
      "   [0.125]\r\n",
      "   [0.169]\r\n",
      "   [0.569]\r\n",
      "   [0.88 ]\r\n",
      "   [0.078]\r\n",
      "   [0.221]\r\n",
      "   [0.43 ]\r\n",
      "   [0.703]\r\n",
      "   [0.172]\r\n",
      "   [0.228]\r\n",
      "   [0.33 ]\r\n",
      "   [0.829]\r\n",
      "   [0.798]\r\n",
      "   [0.759]\r\n",
      "   [0.124]\r\n",
      "   [0.137]\r\n",
      "   [0.222]\r\n",
      "   [0.547]\r\n",
      "   [0.112]\r\n",
      "   [0.304]\r\n",
      "   [0.074]\r\n",
      "   [0.344]\r\n",
      "   [0.786]\r\n",
      "   [0.569]\r\n",
      "   [0.288]\r\n",
      "   [0.192]]\r\n",
      "\r\n",
      "  [[0.205]\r\n",
      "   [0.676]\r\n",
      "   [0.823]\r\n",
      "   [0.66 ]\r\n",
      "   [0.019]\r\n",
      "   [0.135]\r\n",
      "   [0.962]\r\n",
      "   [0.68 ]\r\n",
      "   [0.19 ]\r\n",
      "   [0.238]\r\n",
      "   [0.403]\r\n",
      "   [0.228]\r\n",
      "   [0.98 ]\r\n",
      "   [0.419]\r\n",
      "   [0.307]\r\n",
      "   [0.726]\r\n",
      "   [0.634]\r\n",
      "   [0.732]\r\n",
      "   [0.45 ]\r\n",
      "   [0.757]\r\n",
      "   [0.53 ]\r\n",
      "   [0.869]\r\n",
      "   [0.283]\r\n",
      "   [0.143]\r\n",
      "   [0.805]\r\n",
      "   [0.232]\r\n",
      "   [0.525]\r\n",
      "   [0.55 ]]\r\n",
      "\r\n",
      "  [[0.712]\r\n",
      "   [0.512]\r\n",
      "   [0.908]\r\n",
      "   [0.655]\r\n",
      "   [0.136]\r\n",
      "   [0.133]\r\n",
      "   [0.403]\r\n",
      "   [0.518]\r\n",
      "   [0.172]\r\n",
      "   [0.984]\r\n",
      "   [0.776]\r\n",
      "   [0.06 ]\r\n",
      "   [0.784]\r\n",
      "   [0.46 ]\r\n",
      "   [0.281]\r\n",
      "   [0.698]\r\n",
      "   [0.209]\r\n",
      "   [0.862]\r\n",
      "   [0.37 ]\r\n",
      "   [0.98 ]\r\n",
      "   [0.328]\r\n",
      "   [0.195]\r\n",
      "   [0.786]\r\n",
      "   [0.222]\r\n",
      "   [0.741]\r\n",
      "   [0.524]\r\n",
      "   [0.297]\r\n",
      "   [0.021]]\r\n",
      "\r\n",
      "  [[0.923]\r\n",
      "   [0.54 ]\r\n",
      "   [0.257]\r\n",
      "   [0.1  ]\r\n",
      "   [0.793]\r\n",
      "   [0.992]\r\n",
      "   [0.106]\r\n",
      "   [0.435]\r\n",
      "   [0.094]\r\n",
      "   [0.53 ]\r\n",
      "   [0.457]\r\n",
      "   [0.15 ]\r\n",
      "   [0.284]\r\n",
      "   [0.019]\r\n",
      "   [0.811]\r\n",
      "   [0.835]\r\n",
      "   [0.422]\r\n",
      "   [0.112]\r\n",
      "   [0.16 ]\r\n",
      "   [0.314]\r\n",
      "   [0.581]\r\n",
      "   [0.238]\r\n",
      "   [0.136]\r\n",
      "   [0.118]\r\n",
      "   [0.069]\r\n",
      "   [0.826]\r\n",
      "   [0.779]\r\n",
      "   [0.35 ]]\r\n",
      "\r\n",
      "  [[0.709]\r\n",
      "   [0.162]\r\n",
      "   [0.412]\r\n",
      "   [0.893]\r\n",
      "   [0.03 ]\r\n",
      "   [0.818]\r\n",
      "   [0.195]\r\n",
      "   [0.523]\r\n",
      "   [0.547]\r\n",
      "   [0.168]\r\n",
      "   [0.718]\r\n",
      "   [0.294]\r\n",
      "   [0.507]\r\n",
      "   [0.405]\r\n",
      "   [0.36 ]\r\n",
      "   [0.483]\r\n",
      "   [0.06 ]\r\n",
      "   [0.9  ]\r\n",
      "   [0.276]\r\n",
      "   [0.877]\r\n",
      "   [0.363]\r\n",
      "   [0.197]\r\n",
      "   [0.063]\r\n",
      "   [0.076]\r\n",
      "   [0.759]\r\n",
      "   [0.427]\r\n",
      "   [0.339]\r\n",
      "   [0.942]]\r\n",
      "\r\n",
      "  [[0.058]\r\n",
      "   [0.93 ]\r\n",
      "   [0.589]\r\n",
      "   [0.873]\r\n",
      "   [0.165]\r\n",
      "   [0.784]\r\n",
      "   [0.552]\r\n",
      "   [0.648]\r\n",
      "   [0.491]\r\n",
      "   [0.291]\r\n",
      "   [0.39 ]\r\n",
      "   [0.966]\r\n",
      "   [0.967]\r\n",
      "   [0.652]\r\n",
      "   [0.982]\r\n",
      "   [0.474]\r\n",
      "   [0.703]\r\n",
      "   [0.869]\r\n",
      "   [0.799]\r\n",
      "   [0.102]\r\n",
      "   [0.267]\r\n",
      "   [0.106]\r\n",
      "   [0.188]\r\n",
      "   [0.568]\r\n",
      "   [0.474]\r\n",
      "   [0.69 ]\r\n",
      "   [0.156]\r\n",
      "   [0.855]]\r\n",
      "\r\n",
      "  [[0.551]\r\n",
      "   [0.414]\r\n",
      "   [0.006]\r\n",
      "   [0.677]\r\n",
      "   [0.719]\r\n",
      "   [0.958]\r\n",
      "   [0.964]\r\n",
      "   [0.422]\r\n",
      "   [0.179]\r\n",
      "   [0.798]\r\n",
      "   [0.358]\r\n",
      "   [0.966]\r\n",
      "   [0.774]\r\n",
      "   [0.519]\r\n",
      "   [0.067]\r\n",
      "   [0.717]\r\n",
      "   [0.188]\r\n",
      "   [0.587]\r\n",
      "   [0.268]\r\n",
      "   [0.804]\r\n",
      "   [0.918]\r\n",
      "   [0.818]\r\n",
      "   [0.887]\r\n",
      "   [0.377]\r\n",
      "   [0.863]\r\n",
      "   [0.882]\r\n",
      "   [0.547]\r\n",
      "   [0.455]]\r\n",
      "\r\n",
      "  [[0.278]\r\n",
      "   [0.23 ]\r\n",
      "   [0.245]\r\n",
      "   [0.029]\r\n",
      "   [0.697]\r\n",
      "   [0.623]\r\n",
      "   [0.41 ]\r\n",
      "   [0.385]\r\n",
      "   [0.595]\r\n",
      "   [0.043]\r\n",
      "   [0.372]\r\n",
      "   [0.076]\r\n",
      "   [0.085]\r\n",
      "   [0.565]\r\n",
      "   [0.946]\r\n",
      "   [0.461]\r\n",
      "   [0.193]\r\n",
      "   [0.138]\r\n",
      "   [0.259]\r\n",
      "   [0.042]\r\n",
      "   [0.706]\r\n",
      "   [0.087]\r\n",
      "   [0.662]\r\n",
      "   [0.76 ]\r\n",
      "   [0.28 ]\r\n",
      "   [0.827]\r\n",
      "   [0.121]\r\n",
      "   [0.903]]\r\n",
      "\r\n",
      "  [[0.599]\r\n",
      "   [0.265]\r\n",
      "   [0.632]\r\n",
      "   [0.924]\r\n",
      "   [0.739]\r\n",
      "   [0.816]\r\n",
      "   [0.374]\r\n",
      "   [0.822]\r\n",
      "   [0.672]\r\n",
      "   [0.349]\r\n",
      "   [0.245]\r\n",
      "   [0.071]\r\n",
      "   [0.799]\r\n",
      "   [0.73 ]\r\n",
      "   [0.342]\r\n",
      "   [0.196]\r\n",
      "   [0.749]\r\n",
      "   [0.987]\r\n",
      "   [0.419]\r\n",
      "   [0.667]\r\n",
      "   [0.28 ]\r\n",
      "   [0.526]\r\n",
      "   [0.298]\r\n",
      "   [0.241]\r\n",
      "   [0.071]\r\n",
      "   [0.544]\r\n",
      "   [0.079]\r\n",
      "   [0.126]]\r\n",
      "\r\n",
      "  [[0.376]\r\n",
      "   [0.599]\r\n",
      "   [0.283]\r\n",
      "   [0.94 ]\r\n",
      "   [0.4  ]\r\n",
      "   [0.318]\r\n",
      "   [0.721]\r\n",
      "   [0.594]\r\n",
      "   [0.869]\r\n",
      "   [0.025]\r\n",
      "   [0.107]\r\n",
      "   [0.626]\r\n",
      "   [0.89 ]\r\n",
      "   [0.792]\r\n",
      "   [0.22 ]\r\n",
      "   [0.33 ]\r\n",
      "   [0.188]\r\n",
      "   [0.651]\r\n",
      "   [0.657]\r\n",
      "   [0.991]\r\n",
      "   [0.355]\r\n",
      "   [0.854]\r\n",
      "   [0.107]\r\n",
      "   [0.802]\r\n",
      "   [0.594]\r\n",
      "   [0.125]\r\n",
      "   [0.197]\r\n",
      "   [0.995]]]]\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "RECEIVED RESPONSE:\r\n",
      "meta {\r\n",
      "  puid: \"joula4u5bus83nk1jklaqsje4t\"\r\n",
      "  requestPath {\r\n",
      "    key: \"nodejs-mnist-classifier\"\r\n",
      "    value: \"node-s2i-mnist-model:0.1\"\r\n",
      "  }\r\n",
      "}\r\n",
      "data {\r\n",
      "  names: \"t:0\"\r\n",
      "  names: \"t:1\"\r\n",
      "  names: \"t:2\"\r\n",
      "  names: \"t:3\"\r\n",
      "  names: \"t:4\"\r\n",
      "  names: \"t:5\"\r\n",
      "  names: \"t:6\"\r\n",
      "  names: \"t:7\"\r\n",
      "  names: \"t:8\"\r\n",
      "  names: \"t:9\"\r\n",
      "  ndarray {\r\n",
      "    values {\r\n",
      "      list_value {\r\n",
      "        values {\r\n",
      "          number_value: 0.06535089015960693\r\n",
      "        }\r\n",
      "        values {\r\n",
      "          number_value: 0.055538177490234375\r\n",
      "        }\r\n",
      "        values {\r\n",
      "          number_value: 0.14983375370502472\r\n",
      "        }\r\n",
      "        values {\r\n",
      "          number_value: 0.1822187453508377\r\n",
      "        }\r\n",
      "        values {\r\n",
      "          number_value: 0.09671169519424438\r\n",
      "        }\r\n",
      "        values {\r\n",
      "          number_value: 0.03943844884634018\r\n",
      "        }\r\n",
      "        values {\r\n",
      "          number_value: 0.0619128979742527\r\n",
      "        }\r\n",
      "        values {\r\n",
      "          number_value: 0.13100355863571167\r\n",
      "        }\r\n",
      "        values {\r\n",
      "          number_value: 0.18306931853294373\r\n",
      "        }\r\n",
      "        values {\r\n",
      "          number_value: 0.03492257371544838\r\n",
      "        }\r\n",
      "      }\r\n",
      "    }\r\n",
      "  }\r\n",
      "}\r\n",
      "\r\n",
      "\r\n"
     ]
    }
   ],
   "source": [
    "!seldon-core-api-tester contract.json `minikube ip` `kubectl get svc ambassador -o jsonpath='{.spec.ports[0].nodePort}'` \\\n",
    "    seldon-deployment-example --namespace seldon -p"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🔥  Deleting \"minikube\" from virtualbox ...\n",
      "💔  The \"minikube\" cluster has been deleted.\n"
     ]
    }
   ],
   "source": [
    "!minikube delete"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
